How can I determine which packages where installed because I requested the installation and which packages where automatically installed in order to satisfy dependencies?
In aptitude, this information is shown as "A":
i A fam ...
i grub ...
i A grub-common ...
This shows that I requested the package grub and that grub-common was installed as a result of this. However, aptitude is an interactive program, I cannot extract this information automatically to process it with a script.
With the debian package management tool 'dpkg -l' or 'dpkg --get-selections', I can get a list of installed package with additional information. E.g.
> dpkg -l
...
ii grub 0.97-47lenny2 GRand Unified Bootloader (Legacy version)
ii grub-common 1.96+20080724-16 GRand Unified Bootloader, version 2 (common files)
ii gs-common 8.62.dfsg.1-3.2lenny1 Dummy package depending on ghostscript
...
This list can easily be processed with scripts, but it only shows that the packages are installed --- not whether by request or for dependencies.