Skip to content

Instantly share code, notes, and snippets.

@xorenio
Created February 12, 2016 10:47
Show Gist options
  • Save xorenio/90d0081e9288302710fe to your computer and use it in GitHub Desktop.
Save xorenio/90d0081e9288302710fe to your computer and use it in GitHub Desktop.
This bash script fixes the problem on fresh installs of ubuntu 12.04 installed as a VM on Proxmox, VMware or any container host. On fresh install apt is broken I have mainly seen this problem when installing VMs on OVH
#!/bin/bash
rm /var/lib/apt/lists/* -vf
apt-get clean
apt-get -y autoremove
apt-get -y update
apt-get -y dist-upgrade
apt-get clean
cd /var/lib/apt
mv lists lists.old
mkdir -p lists/partial
apt-get clean
apt-get update
apt-get -y dist-upgrade
apt-get -y install linux
echo "Fixed APT-GET"
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment