Apt/Aptitude: how to filter packages that are impossible to install

aptaptitude

Especially when running Sid, there are many packages that become non-installable as the dependencies change ABI versions, or the dependencies themselves may have been dropped. It'd be good to know how to filter these packages so that a potential maintainer can check what problematic packages are there on the repo.

So far I came up with:

#!/bin/sh
apt-cache pkgnames|xargs apt-get -s install\
|sed "/ : /h;/installable/{x;/ .* :/{s/ \(.*\) :.*/\1/;b}};d" | sort

It does not recursively mark packages which depend on package "not going to be installed" X, where X is package that is marked because one of the dependecies is "not installable". E.g in the following:

foo : Depends on bar but not going to be installed
bar : Depends on baz but not installable

bar will be marked but foo will not. And I shouldn't just mark all packages that has the line "not going to be installed" because it could be bar is a package that exists but breaks another installed package.

Best Answer

Assuming you know Python, and if you don't today is a good day to start...the documentation for the apt python bindings has a worked example which is relevant, though it may not be a complete solution.

apt-get install python-apt python-apt-doc

and look at /usr/share/doc/python-apt-doc/examples/missing-deps.py. I'm using Debian squeeze.

I just tried it

python missing-deps.py

and it does produce a small list of packages. My understanding of this script is that it produces a list of packages that are currently uninstallable on Debian main. However, I don't have a Debian unstable installation handy at the moment to test it with.

Related Question