Debian has a lot of packages in its repositories, “it comes with over 18733 packages” according to the Debian web site as I write this, so when you add third party repositories a flexible package management tool that can sort, filter and categorise the packages can be helpful. Thankfully, aptitude does a pretty decent job of it.

Axel Beckert shows how to group packages by origin in aptitude by adding “pattern(~O)” to the default groups. I find this handy, but also got hit by the problem of virtual packages not being displayed. After a bit of a read and a play, I came up with:

Aptitude::UI {
  Default-Grouping "filter(missing),status,section(subdir,passthrough),pattern(~O, !~O => other),section(topdir),priority";
};

Anything that doesn’t have an origin gets put into a hierarchy called “other”. At least that’s what I think, and it looks like it does! Next to find out how to display the suite (stable, testing, etc) for each package version.

Update: Grouping by archive shows, for example, a package in both testing and unstable under both groups, but does not indicate which versions of the package are in each archive. A satisfactory solution is to add “%t” to the package display format as follows:

Package-Display-Format "%c%a%M%S %p %Z %t %15v %15V";

The main package view shows the archives that contain the preferred (I presume) version of the package. Slightly more useful, when versions are expanded, the archive will be shown for each available version of the package:

i A  --\ apt                stable          0.6.46.4-0.1 0.6.46.4-0.1
i A  0.6.46.4-0.1           stable
p A  0.7.6                  testing