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?