0

I tried upgrading to Ubuntu 16.04.1, not sure exactly what happened but it didn't finish.

I am now having problems with apt-get. /usr/bin/dpkg is empty. Is there a way I can replace the contents of that file in order to get apt-get back to running?

When I do dpkg -l I get:

The program 'dpkg' is currently not installed. You can install it by typing:
sudo apt install dpkg

When I do sudo apt install dpkg I get:

Sub-process /usr/bin/dpkg returned an error code (100)
Zanna
  • 70,465

2 Answers2

0

If dpkg-deb is still present you can use it to extract deb files. You may be able to manually extract the deb file from /var/cache/apt/archives and then manually copy the file into place. You could also potentially copy the file across from another system.

But honestly I suspect you will find that your system is sufficiently broken that it's easier to backup your data files and reinstall. I strongly suspect that if one file is damaged in this way others are too.

Peter Green
  • 1,841
  • 1
  • 12
  • 15
0

You can always go to the Ubuntu Package repository to download any item that you might have accidentally deleted, but if an upgrade never finished, the above might not work as essential data files are missing as well and then you might as well reinstall.

Fabby
  • 34,259