Templates in Aptitude


Small trick with aptitude, package manager in Debian-based distributions.

Aptitude’s search understands some templates in search. Several of them:

~ntext — all packages with name containing text

~dtext — with description containing text

~i — installed packages

~c — removed (not purged) packages

~N — new packages in repository

~U — upgradable packages

~Dtext — packages depend of packages text

~Rtext  — packages that depend of text

| — OR

! —  NOT


Case studies:

aptitude purge ‘~c’ — purge all removed packages

aptitude search ~neclipse — search all packagse with name containing   eclipse

aptitude search ‘~i(~nfirefox|~niseweasel) ‘ –all installed packages with ‘firefox’ or ‘isewease’ in package name

aptitude search ‘!~i~dkde’  — not installed packages with ‘kde’ in description