What packages are installed by default in Debian? Is there a term for that set? Why some of those packages are `automatically installed` and some not?

The base system is described in Debian policy as all packages with required or important priority.

You can search for the packages that the required and important priorities are attached to with the aptitude utility.

aptitude search ~prequired -F"%p"
aptitude search ~pimportant -F"%p"

debootstrap installs these packages during the setup process.
tasksel will then install whatever other roles you choose on top, normally standard is the default selection that is used.

On top of what is listed in the base system you will get

  • A Kernel (thankfully)
  • Input/Locale/Dictionary packages.
  • Hardware packages. (ACPI, USB, PCI, Virtual guest additions on vm's)
  • Then some dependent libraries to support the above.

This amounts to about 60 packages on my VirtualBox VM (without the VBox guest additions which pull in a lot of dependencies).

Run the Expert Install (select "Advanced options > Expert") if you get a chance. It gives you a better idea of the step by step install process and when apt is being run outside of the base install.


Also, what about automatically installed status for those packages? They don't always get this flag, right?

All packages that are only installed because another installed package depended on them should have this flag. The package manager uses this flag to find unused/orphaned packages, that is, packages that are installed although there is no longer another package installed that depends on these packages. Such orphaned packages will be automatically removed.

For example, let's say you install the package exim4-daemon-light. This package depends on exim4-base, so the package manager has to install both of these packages on your system. The flags are then set like this:

  • exim4-daemon-light: not automatically installed, because you explicitly told the package manager to install it
  • exim4-base: automatically installed; you didn't explicitly tell the package manager to install it, but it had to install this package automatically because exim4-daemon-light depends on it

When you now tell the package manager to remove exim4-daemon-light, it uses the "automatically installed" flag of exim4-base to determine that this package can be removed too. It looks at the list of installed packages that depend on exim4-base, and if there are none, it will remove exim4-base.

This mechanism essentially ensures that your system doesn't keep unnecessary packages around.

You can modify the flag with the aptitude commands markauto and unmarkauto. This will have the following effects:

  • aptitude markauto: as soon as there are no longer any packages installed that depend on this package it will be automatically removed. If there aren't currently any packages installed that depend on this package, it will be removed immediately.
  • aptitude unmarkauto: the package will never be removed automatically, even if there are no packages installed that depend on it.