Debian – apt update blocked by cyclical dependices

aptdebianupgrade

I have Debian running on a VPS instance that is kept alive for a little site/project that is used by a small user base on an irregular basis. The server is largely left alone but I try to login every now and then to keep packages up to date. Today I realised that I had not been on the server for quite some time and logged in to run apt-get update && apt-get upgrade.

Other than the fact that there were a large number of packages with updates available, everything seemed to go well until the upgrade process stopped abruptly with the following message:

Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/mime-support_3.58_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Running apt-get upgrade for a second time showed that the bulk of packages to be updated were being kept back by "mime-support".

Preparing to replace mime-support 3.48-1 (using .../mime-support_3.58_all.deb) ...
dpkg: error processing /var/cache/apt/archives/mime-support_3.58_all.deb (--unpack):
 triggers ci file contains unknown directive `interest-noawait'
configured to not write apport reports
                                  Errors were encountered while processing:
 /var/cache/apt/archives/mime-support_3.58_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

A little Googling revealed that the mime-support update has a dependency on a dpkg feature "interest-noawait" which, as it happens, is included in the dpkg update being held back by mime-support…

It seems to me that I can't upgrade dpkg to the latest version because it has a dependency on mime-support which, in turn, can't be upgraded because of a dependency on a newer version of dpkg?

Is it possible to manually install the latest version of dpkg to get around this error?
I tried to remove mime-support but that could not be done due to a number of other dependencies.

Best Answer

I had a similar problem. I found elsewhere that the solution is to replace the old dpkg executable for a new version. It it worked for me.

First you need to download a current version of dpkg:

i386 version

wget https://launchpad.net/ubuntu/+archive/primary/+files/dpkg_1.18.4ubuntu1.1_i386.deb

or

amd64 version

wget https://launchpad.net/ubuntu/+archive/primary/+files/dpkg_1.18.4ubuntu1.1_amd64.deb

After, you extract the new dpkg binary and put it in the place of the old one:

ar x dpkg_1.18.4ubuntu1.1_amd64.deb tar -xfvz data.tar.gz
sudo cp ./usr/bin/dpkg /usr/bin/
sudo apt-get update
sudo apt-get install --reinstall dpkg

That did the trick.

Related Topic