A crucial but often entirely transparent feature of a modern package management system like Debian’s APT is its solver – basically the set of rules and instruction on how to handle dependencies when installing a package. APT is currently in the process of radically changing its solver, the first bits of which can be found in APT 2.9.3, referred to as solver3. Many of the changes and improvements get a little into the weeds and will mostly be transparent to users, but there is one feature the new solver will enable that many of you will be incredibly excited about.
One of the core new capabilities of solver3 is the implication graph.
As part of the solving phase, we also construct an implication graph, albeit a partial one: The first package installing another package is marked as the reason (A -> B), the same thing for conflicts (not A -> not B).
Julian Andres Klode
Seems rather innocuous at first sight, but here’s what the implication graph will make possible:
The implication graph building allows us to implement an
Julian Andres Klodeapt why
command, that while not as nicely detailed as aptitude, at least tells you the exact reason why a package is installed. It will only show the strongest dependency chain at first of course, since that is what we record.
If you’ve ever dealt with packaging issues – probably when running -testing or similar unstable distributions that use APT, a command that tells you exactly why a package is installed is an absolute godsend. Sure, aptitude exists, but aptitude takes you out of your current CLI workflow, whereas this will be much easier to quickly run.
There’s more features solver3 will enable, but this one is definitely one of my favourite low-level additions to APT in a long, long time.
This is one of the cases of “where will we use all these algorithms in real life? why are we asked to do these problems for interviews” makes real life impact.
Granted these are rare, but when happens causes major boosts to existing features, or enables completely new features.
Bottom line, good job, let’s hope they continue improving apt usage for these rare but really troubling corner cases.
Same trouble with the Python package solver. It would be better to have this standardized once and for all.
Kochise,
For Python, mamba solves most of the issues. (It is a C++ reimplementation of conda). It is really fast, and can resolves disputes or even downgrade packages as necessary.
The only problem is the repos are not expensive as pip and sometimes I’d have to do things like mamba create -n torch pytoch python=3.10 pip and install the rest there (with less support for fixing cross-version issues).
> aptitude takes you out of your current CLI workflow
You are apparently unaware that aptitude can be used from the CLI as well as via its TUI – just run “aptitude why some-package”.