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?

38,926

Solution 1

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.

Solution 2

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.
Share:
38,926

Related videos on Youtube

CoOl
Author by

CoOl

Updated on September 18, 2022

Comments

  • CoOl
    CoOl over 1 year

    Is there a term to refer to the subset of packages that is automatically installed by Debian distribution?

    I though that it had something to do with packages priorities, but it doesn't seem to be the case, cause there are packages of all the priority levels among the packages installed by default.

    Also, some of those packages of initial subset have automatically installed flag, e.g. wireless-tools. So they will be automatically removed if packages of the initial subset, depending on them, are manually removed. I wonder, does the installation tool keep only a list of packages to be considered manually installed and installs their dependencies automatically?

    Answer to the first two questions: After installing the core Debian utilities, Debian installer seems to invoke tasksel to carry out installation "tasks". Among the typical tasks are "standard" task and "laptop" task. From tasksel page:

    "standard" task

    The standard task is a special task used by Debian Installer. It actually relies on the packages' priority. What does the "standard system" task include?

    tasksel --task-packages standard

    which is an aptitude search string that equates to

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

    So tasksel installs standard, required and important packages.

    "laptop" task

    The laptop task is a special task use by Debian Installer, to pull the packages useful on a laptop:

    • wireless-tools
    • acpi-support
    • cpufrequtils
    • acpi
    • wpasupplicant
    • powertop
    • acpid
    • apmd
    • pcmciautils
    • pm-utils
    • anacron
    • avahi-autoipd
    • bluetooth

    Desktop

    See https://wiki.debian.org/DebianDesktop/Tasks

    • Admin
      Admin over 10 years
      @terdon ok, but how the installer decides, which packages to install in a particular case and which not?
    • Admin
      Admin over 10 years
      Well, if you have a touchpad, it will install a synaptics driver, if you don't it won't. I see what you're getting at but you should try an narrow your question down to those packages that are hardware agnostic.
    • Admin
      Admin over 10 years
      @terdon Yes, but what part of installer takes the decision? I haven't found any words about that in the documentation.
    • Admin
      Admin over 10 years
      What do you mean? The installer probes your hardware and installs the appropriate software.
    • Admin
      Admin over 10 years
    • Admin
      Admin over 10 years
      A Debian kernel package for a specific architecture will come with a set of precompiled modules that are all installed with the kernel (find /lib/modules). It will then select which of those installed modules to load for hardware support (unless something is compiled into the kernel).
    • Admin
      Admin over 10 years
      packages are marked 'automatic' if they were pulled in as a dependancy of another package, rather than being deliberately selected by the user. This is so that if you later decide to remove that package, you can remove the automatic packages with apt-get autoremove - otherwise, it's not significant.
  • CoOl
    CoOl over 10 years
    Aha, the tasksel is the key! Thanks! By default it runs the "standard" task and usually the "laptop" task: wiki.debian.org/tasksel
  • psusi
    psusi over 10 years
    tasksel installs sets of extra packages at the end of the installation based on their Task: attribute and which tasks you select for installation. The required and important packages are installed in the first phase by debootstrap. The required packages are unpacked by hand, and represent the minimum requirements to be able to run dpkg to install the important packages, and then configure the required and important packages.
  • Matt
    Matt over 10 years
    How much more? there will be some stuff like the kernel, locales, grub. The biggest addition post base install I saw before selecting a role was that it picked up on being a Virtualbox guest and some dependancy creep for the guest additions got in.
  • Matt
    Matt over 10 years
    @psusi yeah i was just reading this as my install seemed to have another step before tasksel where it goes out to the net and fetches. I'm guessing pkg updates and some hardware detection but trying to confirm that
  • CoOl
    CoOl over 10 years
    @psusi guys, I just started going through "laptop" task packages and found that acpid is marked as manually installed, while wireless-tools as automatically. Do you understand the logic behind those decisions?
  • CoOl
    CoOl over 10 years
    @psusi Oh, I'm being dumb again. Because acpid is a toplevel package, it can't be marked automatic or will get uninstalled, while wireless-tools won't be uninstalled cause it is suggested by pcmciautils etc. Thanks and sorry.
  • Shruti
    Shruti about 9 years
    It looks like the aptitude commands may list multiple versions of the same package (i.e., the first one returns "gcc-4.7-base" "gcc-4.8-base" "gcc-4.9-base"). Is there a way to filter the output and keep only the latest versions?
  • Matt
    Matt about 9 years
    They are separate packages, which are all required. The version would not normally be in the package name unless they want to keep multiple versions.