Ubuntu – Apt-Get system completely broken. possible to completely reinstall it?


I just recently noticed my apt-get system is broken. I have tried everything I can to fix it but everything I'm told just ends up with a message saying that the apt-get system is corrupt and unfixable. When I try to install a package, it says it can't find it. How can I completely reinstall apt-get? Is there even such a thing?

Best Answer

You can download apt packages from Ubuntu repos and install them manually.

At first, create a directory in ~/Downloads and go into it:

mkdir ~/Downloads/apt-packs
cd ~/Downloads/apt-packs

And then download all apt packages corresponding to your architecture (amd64 or i386). For example, you have amd64 (Ubuntu 64bit):

Download following deb packages for apt (apt and its dependencies):

wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-inst2.0_1.1.5_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg5.0_1.1.5_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt-utils_1.1.5_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.1.5_amd64.deb

Finally, install them all with dpkg:

sudo dpkg -i *.deb
Related Question