1

While trying to solve some package conflicts, mistakenly I ran this command on my Ubuntu-Precise:

sudo dpkg -r --force-all libc6

Consequently in a second all of the packages with a dependency to libc6 are removed, and whatever command I run, I get

-bash: /usr/bin/MY_COMMAND: No such file or directory

I can access the /bin/busybox but then when I want to reinstall libc6 package via

/bin/busybox dpkg --force-depends -i install libc6

I get "permission denied".

The Sudo command of course doesn't work either!!

Does anyone has a suggestion on how I can install unistalled packages!

bijbij
  • 13
  • 1
  • 4

2 Answers2

0

You could login as root, but Ubuntu locks the root account by default and you have probably uninstalled the tools needed to enable it. You could possibly find a su binary and just add it to /usr/bin/su. But you would need to add all the dependencies from scratch.

You could follow the advice here and use a chroot environment with a liveCD to reinstall libc6.

I think your best bet, unless you want to spend hours scraping together tar files, is to reinstall your system and hope that you have current backups.

There is a post on serverfault about this problem. But unless you have a lot of time on your hands I would just reinstall.

noel
  • 314
  • I agree with this part -- backup personal files and reinstall (unless you have lots of time and patience). – belacqua Jun 09 '13 at 00:45
0

As mentioned in the other answer, reinstalling is the best solution I found. Meanwhile, I tried following steps (with no success) that might worth to be mentioned:

  1. Grub boot loader automatically started after the second restart, but crashed while loading. So, the missing packages didn't even allowed to boot in recovery mode.

  2. I used a bootable usb to start Ubuntu (without installation). Then I tried to copy missing packages from an identical system, but it did not help at all. I gave up somewhere in between and didn't copy all the files.

  3. Mounting the hard drive and installing packages on it, using the bootable usb was not doable either, because the missing libraries did not allow me even to get root access over the hard drive.

So, the final solution that I found was to make backups of /etc, /opt, /root, /var, and /home and reinstall a new Ubuntu by erasing the previous version. Later the /etc folder helped me a lot to bring back some of tricky settings.

bijbij
  • 13
  • 1
  • 4