0

I have an error on Ubuntu 16.04 when I use

 sudo apt-get upgrade

enter image description here

1

1 Answer 1

3

Go to this url http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/ and you will see a list of dpkg packages. You need to find the dpkg version you need than open new terminal. Anywhere your machine I select Desktop.

mkdir dpkg 
cd dpkg

Run:

wget http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/ 

(Add the version of dpkg you need after the last /)

For example I needed dpkg_1.17.5ubuntu5.2_amd64.deb but this does not exist any more so I chose the closest one which is

dpkg_1.17.5ubuntu5.8_amd64.deb 

So:

wget http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.17.5ubuntu5.8_amd64.deb

Run

ar x dpkg_1.17.5ubuntu5.8_amd64.deb 

Now you can see the contents:

~/dpkg $ ls
control.tar.gz  data.tar.gz  debian-binary  dpkg_1.17.5ubuntu5.8_amd64.deb

Run

~/dpkg $ tar xfvz data.tar.gz ./usr/bin/dpkg
./usr/bin/dpkg
~/dpkg $ ls
control.tar.gz  data.tar.gz  debian-binary  dpkg_1.17.5ubuntu5.8_amd64.deb  usr
~/dpkg $ cd usr/bin/
~/dpkg/usr/bin $ ls
dpkg

~/dpkg/usr/bin $ sudo cp dpkg /usr/bin/

Then you can run:

sudo apt-get update

I hope that helps.

Not the answer you're looking for? Browse other questions tagged or ask your own question.