Ubuntu upgrade: solving the unresolvable package issue

I’m doing my 3rd and 4th upgrade of machines to Ubuntu 11.10 today. The early results on my laptop have been very good (Unity seems way less crashy now), so I’m upgrading a number of other systems I’ve got.

When first trying to upgrade my home server, which has gone through a series of upgrades, I got an error like this about not being able to resolve some packages for upgrade:

E:Error, pkgProblemResolver::Resolve

Solution

It turns out that one of my past upgrades probably wasn’t done cleanly, so there were some really old packages on this system. The upgrade logs will be stored in /var/log/dist-upgrade/main.log. In that file, you’ll find an analysis of your packages that will include references to “Foreign” and “Obsolete” packages that were found.

Take the list of everything in Obsolete and run “aptitude remove” on them. As soon as it is done you can kick off the upgrade again, and all will be good.