I've inherited an Ubuntu 12.04 server where package management is completely messed up. Any aptitude command fails with errors like this one (for every installed package, as far as I can tell):

dpkg: dependency problems prevent configuration of grub-common:
 grub-common depends on libdevmapper1.02.1 (>= 2:1.02.36); however:
  Package libdevmapper1.02.1 is not configured yet.

There are dozens of unresolved dependencies, and trying to resolve them leads to further unresolved dependencies. In addition, there are dozens of other errors I can't even find anywhere (and won't describe). I can't spend more hours trying to fix this.

Is there any possible way to "reset" aptitude and start with a clean slate, without actually removing currently installed and configured packages?

  • 2
    At this point, you should just reinstall. – EEAA May 10 '15 at 12:29
  • What happens when you try to configure the package(s) it says are not configured yet? – Håkan Lindqvist May 10 '15 at 14:16
  • aptitude install perhaps, (with no further arguments) so as to give the packaging system an opportunity to complete the outstanding installation tasks. – roaima May 10 '15 at 14:19
  • @HåkanLindqvist: just more strange configuration issues. Already tried aptitude install. I suppose reinstall is the best option here. – kontextify May 11 '15 at 10:33
  • I could not install VLC on Ubuntu 16.04 with aptitude without removing Unity and 300 packages according to aptitude. apt-get remove aptitude followed by an install did not help. As a workaround I used apt-get to install VLC which worked. Aptitude really needs a reset command. – Underverse Sep 9 '17 at 14:35

Try running:

 # dpkg --configure --pending
 # dpkg --configure -a
 # apt-get -f install

If that doesn't help, and you are unable to resolve further conflicts/problems on your own or get someone whos more experienced with dpkg at the helm, or just backup /etc and reinstall.

| improve this answer | |
  • None of that resolves the configuration/dependency nightmare. I guess backup and reinstall is the way to go here. – kontextify May 11 '15 at 10:35

If you find aptitude state completely messed up, you can try (as root):

# rm -f /var/lib/aptitude/pkgstates*

And then restart it. That should clear aptitude's idea of what needs to be (re)installed/upgraded and then you can Update from there.

This happens to me periodically if I change the sources list or alter the release Pins in preferences and it gets into a package resolution disaster (or runs forever trying to find an upgrade path).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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