Erich Schubert wonders how to improve the handling of conflicts in
package managers, particularly in
aptitude full-upgrade and
dist-upgrade. From the point of view of the package manager,
conflicts are a bit tricky to deal with. The problem is that a
conflict only really tells you not to install two packages at once; it
doesn't tell you which package should end up on the system by default.
aptitude has two approaches to this:
When a package is marked for installation in the visual interface or listed on the command-line, then if
aptitudewill automatically resolve conflicts in favor of that package. The same applies to packages that are upgraded by pressing
aptitude's dependency resolver encounters a conflict, it considers both resolutions to the conflict to be equally valid. If there are no other reasons to choose one package over the other, it will be unpredictable which one gets removed first, and even when there are reasons to choose, the user may not understand what they are.
I don't think it's possible to always make upgrades predictable. But
I think that even just making
Auto-Install stick to installing
packages and not removing conflicts would be a plus. Installing
obvious dependencies up-front is good because it means less
work for the resolver and a more predictable starting point. Many
trivial dependency problems can even be completely solved this way.
But removing conflicts is a lot trickier and should probably kick the
problem into the full resolver.
Unfortunately, the code enabled by
Auto-Install is all deep in the
libapt. I've tried to avoid duplicating this code so far,
but it does seem like I periodically run into cases where it doesn't
do exactly what I need, so maybe I'll have to eventually.