Ubuntu – Where Can I Download the Apt Package if apt-get is Missing


I am presently experiencing symptoms as described here:



127-12:42 djh@noneedto ~$ aptitude search chrome
aptitude: error while loading shared libraries: libapt-pkg-libc6.10-6.so.4.8: cannot open shared object file: No such file or directory

127-12:46 djh@noneedto ~$ apt-get -h
The program 'apt-get' is currently not installed.  You can install it by typing:
sudo apt-get install apt
You will have to enable the component called 'main'

So, my thinking, as describe in the bug, is just to download the dpkg for apt. Unfortunately, this is not an easy thing to Google, because usually when people are looking to know about "apt" and "download" and "install" it is "how to use apt-get" … but wher do I get apt from if it is missing in the first place?

I am running Ubuntu 10.04.3 LTS (lucid)

Update: per mailq's answer, the fix here was:

wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_0.7.9ubuntu17.3_amd64.deb
sudo dpkg -i apt_0.7.9ubuntu17.3_amd64.deb

If you are fixing this problem, cruise over to http://archive.ubuntu.com/ubuntu/pool/main/a/apt/ and select a package suitable to your system.

Best Answer

Navigate to the aptitude package page on the Ubuntu website (replace ubuntu.com by debian.org if you're on Debian). Pick the right version (lucid) for you. You either need matching, working aptitude and libapt-pkg-* (provided by apt) packages. Follow the download link for your architecture and download the .deb file(s) that you need.

You can also navigate to the package archive on a Ubuntu mirror (Debian mirror) near you. You can find out precisely which package sources your system normally uses by looking in /etc/apt/sources.list and /etc/apt/sources.list.d/*.list on your system. The packages are organized by distribution component (main/restricted/universe/multiverse for Ubuntu, main/contrib/non-free for Debian) and then by source package. For example, look in http://us.archive.ubuntu.com/ubuntu/pool/main/a/apt/ . All the versions carried by the mirror are in the same directory, so make sure you pick the right one for your system. Note that security upgrades live on a separate server.

Once you've downloaded the .deb files, install them by running the dpkg command as root:

sudo dpkg -i /path/to/package.deb
Related Question