With aptitude:
I can see the number of reverse dependencies with %r
in the display format string (preferences), but how can I group/limit the package list according to that count?
I want to see/filter/search all packages which nobody depends on.
With aptitude:
I can see the number of reverse dependencies with %r
in the display format string (preferences), but how can I group/limit the package list according to that count?
I want to see/filter/search all packages which nobody depends on.
%r
gives you the number of installed packages that depend on that package.
You can list the installed packages for which no installed package depends on with:
aptitude search '~i ! ~R ~i'
You can extend that to recommends and suggests with
aptitude search '~i ! ~R ~i ! ~Rrecommends:~i ! ~Rsuggests:~i'
You can list packages that no package (installed or not) depend on with:
aptitude search '! ~R .'
If your point is to list packages that you can safely remove, then, as pointed out by Braiam, you may want to also exclude essential packages (~E
) and those with required priority (and possibly important).
In aptitude (preferably in flat-list view), press ℓ (lowercase L
) and enter:
~i ! ~R ~i ! ~Rrecommends:~i ! ~Rsuggests:~i ! ~E ! ~prequired ! ~pimportant
(once you remove packages, some more packages may pop up in that list once the packages that depended on them have been removed)
See also ~g
(?garbage
), for the packages which are not installed, or which were automatically installed and are not depended upon by any installed package.
G
: pattern(?any-version(~i ?or(~dtransitional,~ddummy) !~R~i) => trans. pkgs not depended on)
– To look in the description is not safe, but I think there is no better way.
– Robert Siemer
Mar 15 '14 at 14:48
~g
if they are marked as automatically installed. Eventually they will come under ~o
, which selects obsolete packages, when they are removed from the repository. I don't think there is any reliable way to filter for them specifically though.
– Graeme
Mar 15 '14 at 19:26
~i
– I know how to add that. – Robert Siemer Mar 14 '14 at 19:08