apt-get fails to upgrade, install, remove etc

Solution 1:

I recently went through a similar situation trying to install ia32-libs (et al) and I believe you might be suffering from a similar issue to what I was, even if it's slightly different.

  • A long time ago I added the Xorg-edgers PPA. This contains a whole load of bleeding-edge junk for all sorts of packages. Therefore at this point those packages I was using were the newer ones.

  • A time later, I got bored of daily updates to X and various drivers. I disabled the PPA.

  • Even later, I tried installing ia32-libs and found myself in dependency hell.

What was happening was I had a newer version of some package that dpkg was expecting. Rather than downgrading those few packages (as it should probably suggest) it was recommending removing most of the system so that it could remain on the latest version of the X packages.

Fixing it in my case was actually bizarrely simple: I just re-added the PPA I had disabled. After that I could install whatever I liked. This might not be exactly the same for you so be careful.


I bumped into this fix completely accidentally. I had forgotten that I might have newer (and now unavailable) versions of some packages. If I had thought ahead I would have remembered another answer I gave a while ago: How do I revert all packages to their official versions?

The script is slow but it's nothing if not thorough. Disable all PPAs, apt-get update, apt-get dist-upgrade and then use the script to generate a list of things that deviate from the official versions. Purge/reinstall those and you should be able live a happy, dependency-hell-free life.

Solution 2:

I had a similar problem with broken dependencies when trying to install wine and acroread, and a complaint when trying to install ia32-libs-multiarch, just after upgrading to 12.04 from 11.04 (passing over 11.10). It seems that some ppa's I had in 11.04 installed newer versions of applications in the system. After upgrading, the remains of these apps seemed to do some mess in the dependencies.

The solution that seems to work (until now), was found on a german ubuntu board (http://forum.ubuntuusers.de, posts from user Lasall):

First a downgrade is required and done with the following: create the 'preferences' file:

sudo vi /etc/apt/preferences

and insert the following lines:

Package: *       
Pin: release a=precise*
Pin-Priority: 2012

Pin-Priority must be greater than 1000.

Then you may downgrade the offending applications with:

sudo apt-get dist-upgrade

Then you may install packages that complained about dependencies, like sudo apt-get install ia32-libs-multiarch, or sudo apt-get install ia32-libs.

Finally, you should remove the file you just created:

sudo rm /etc/apt/preferences

because else no new updates would be found.

Hope this helps you too!