2

Yesterday I upgraded a laptop from Kubuntu 9.04 (Lucid) to 9.10 (Karmic). Then afterwards I tried to install some software

$ sudo aptitude install dont-remember-what-it-was

and I get

sudo: aptitude: command not found

Wait, what? How can aptitude be missing? And it's not just that - apt-get and dpkg also somehow mysteriously vanished from the system. I've manually checked in /usr/bin and all the other directories in $PATH and verified that the files actually do not exist.

$ ls /usr/bin/aptitude
ls: cannot access /usr/bin/aptitude: No such file or directory

Thankfully I have two graphical package managers available, Adept Installer and KPackageKit. Both of them report that the aptitude package is installed. I tried uninstalling and reinstalling it through the GUI, just to be safe, and the uninstall/reinstall seemed to go off without a hitch. But the actual program binaries are still missing.

Is this something normal? If not, has anyone ever heard of it happening? Is it likely that the missing programs will magically reappear if I upgrade to 10.04?

EDIT: I have no idea what was going on, but after leaving the computer off overnight and a couple of reboots, the problem seems to have fixed itself. All the right files seem to be there.

3
  • I don't know why you would be but are you chrooted?
    – Oli
    Aug 8, 2010 at 23:03
  • @Oli: This is coming directly off a reboot, so unless my computer has learned to run chroot without my knowledge, I doubt that's the case. (And if it has, I think I may have bigger issues than a missing package manager...)
    – David Z
    Aug 8, 2010 at 23:21
  • I'm surprised that the GUI tools didn't report an error when trying to reinstall dpkg - the GUI tools all use dpkg themselves!
    – RAOF
    Aug 9, 2010 at 2:29

3 Answers 3

7

That is definitely not normal!

To get dpkg and apt-get back you can do the following: Download dpkg_1.15.8.2ubuntu3_i386.deb and apt_0.7.25.3ubuntu9.1_i386.deb

ar x dpkg_1.15.8.2ubuntu3_i386.deb
sudo tar -C / -xzf data.tar.gz
ar x apt_0.7.25.3ubuntu9.1_i386.deb
sudo tar -C / -xzf data.tar.gz

Note that some packages at internally compressed with lzma instead of gzip, so one would have to use

sudo tar --lzma -xf data.tar.lzma

Afterwards you should be able to do apt-get update and then install aptitude with

apt-get install --reinstall aptitude

Warning!
I really cant recommend that people install packages like this! Be sure to look at the configuration of the specific package, and if any dependency is missing! And if possible reinstall the packages through apt or dpkg afterwards.

2
  • Turned out I didn't need to do this, but it's good to know how I would manually install the packages if needed.
    – David Z
    Aug 9, 2010 at 3:04
  • +1 for showing how to manually install packages. Aug 9, 2010 at 3:18
1

This is definitely not normal. I suggest you do a filesystemcheck and also check installed files with md5sum like this:

md5sum -c /var/lib/dpkg/info/*.md5sums 2>/dev/null | grep -v OK$

And then maybe reinstall the affected packages with:

sudo apt-get install --reinstall aptitude
2
  • I'll run the FS check but I can't really reinstall aptitude that way since apt-get is missing as well.
    – David Z
    Aug 8, 2010 at 23:23
  • Source Lab's answer should help there. For any package that has md5sum errors you can then use the command above. Aug 8, 2010 at 23:38
0

When you upgraded, Aptitude was uninstalled for some unknown reason. Most likely, it was a bug in the upgrade. Or, Aptitude was incompatible with the new software.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .