Aptitude problem resolver wants to remove lots of unrelated packages

Asked by Daniel Hartwig on 2012-05-26

When installing or removing would break package dependencies, the aptitude problem resolver will often suggest to remove *lots* of unrelated packages. This can happen particularly on multi-arch systems (such as Ubuntu amd64), where the resolver tries to remove most – if not all – foreign-arch packages.

Using apt-get to perform the same action works fine most of the time, with at most a few packages being removed and upgraded as required.

How can I use aptitude in these situations?

EXAMPLE:

The following actions will resolve these dependencies:

      Remove the following packages:
1) aptitude
2) libasound2:i386
3) libc6:i386
4) libc6-i686:i386
5) libdb5.1:i386

79) winetricks
80) xserver-xorg
81) xserver-xorg-input-evdev
82) zlib1g:i386

Daniel Hartwig (wigs) said : #1

> How can I use aptitude in these situations?

Usually, you could select 'next solution' until you find a more reasonable offer. In cases like the above this almost never works.

Instead, you can either ignore the problem resolver, or disable it completely. After this, you can resolve the broken dependencies manually.

* Curses ("interactive") interface

You can make changes to the broken packages like you normally would, using the package views to identify the problems and install/remove packages as needed. Press 'b' to quickly jump to the next broken package.

Be sure to start investigating near the packages you were originally trying to change, as fixing the broken dependencies there can resolve the problem quickly.

* From the command-line

After the suggestion to remove unrelated packages you will be presented with a prompt:

Accept this solution? [Y/n/q/?]

Enter 'x' at this prompt and you will be able to resolve the dependencies by hand. Press '?' for help.

* Disable the problem resolver

If the problem resolver is frequently making these bad suggestions you may find it insufferable. The best solution in these situations is to disable it completely and always fix broken packages by hand. This can be a useful time saver.

Put this line in /etc/apt/apt.conf:

Aptitude::ProblemResolver::StepLimit "0";

Daniel Hartwig (wigs) said : #2

> Put this line in /etc/apt/apt.conf:
>
> Aptitude::ProblemResolver::StepLimit "0";

This will disable the problem resolver always. If you only want to disable it one time, run aptitude like this:

$ sudo aptitude -oAptitude::ProblemResolver::StepLimit=0

Vitaliy Filippov (vitalif) said : #3

Of course this bug is very old already, but I have a simple solution for your problem - just press Ctrl-t to enter aptitude menu and select Actions -> Cancel pending actions.