>>108316037
>APT doesn't allow you to [...]
Actually it can, APT is a very powerful package manager but nobody knows it but all its useful features are hidden behind obscure manpages
>what packages were explicitely installed
APT has a marking system which marks packages as either "manual" when they have been explicitly installed or "auto" when they have been pulled as a dependency.
To list manually installed packages:
apt-mark showmanual
To list automatically installed packages:
apt-mark showauto
You can change the marking of a package using the apt-mark
command, see its manpage for details.
Additionally you have apt depends <package-name>
and apt rdepends <package-name>
which will list out the dependencies and reverse dependencies of a package respectively. If you want to limit it to installed packages then add the --installed
option to that command.
APT also has a more advanced package listing feature known as apt-petterns, see man apt-patterns
for details, for example to list all installed security updates you could do:
apt list "?and(?security, ?installed)"
>what was pre-installed on the system
This is difficult to ascertain, because there is no difference between the Debian installer installing packages and you installing them, since in both cases it's just APT under the hood. However, APT has also four priority rankings for packages, these priorities are:
"required": These packages are essential for the system and must always be present
"important": These are packages that are not essential for the system functioning but are almost always installed because they provide some important functionality
"standard": Standard system utilities, can be installed by Debian installer.
"optional": This is basically everything else.
To list important and required packages:
apt list "?or(?priority(required), ?priority(important))"