Here are some aptitude commands I use regularly but not often enough to remember each time…
List of manually installed packages. Usefull to clone an installation:
- -F set a format string.
- %p is replaced by the package name.
- ~i select all installed packages.
- !~M excludes automaticaly installed packages.
With actually installed versions (usefull if some packages comes from backports or external repositories:
- --disable-columns unset displaying in columns and taking all terminal width.
- %v replaced by the version of the package.
Example: to clone a host (after copying all sources.list files):
aptitude install $(ssh machine_modele aptitude search --disable-columns -F%p=%v ~i\!~M |tr '\n' ' ')
Find updates available in backports or experimental:
aptitude versions '~W(~Awheezy-backports(~W(~i!~M)))' aptitude versions '~W(~Aexperimental(~W(~i!~M)))'
- ~W ignores the version selected by another filter.
- ~Axxx select packages from archive xxx.
Lists upgradable packages:
With version numbers:
Lists modified configuration files:
Backup debconf configurations:
To import as this befor installing packages:
To be continued…