12

Just tried to install the following package in my Buster - monitoring-plugins-standard and noticed the following output:

The following additional packages will be installed:
  dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libarchive13 libassuan0 libavahi-client3 libavahi-common-data libavahi-common3
  libcups2 libdbi1 libgpgme11 libksba8 libldb1 libnet-snmp-perl libnpth0 libpq5 libradcli4 libsensors-config libsensors5 libsmbclient libsnmp-base libsnmp30 libtalloc2 libtdb1
  libtevent0 libtirpc-common libtirpc3 libwbclient0 pinentry-curses python-crypto python-gpg python-ldb python-samba python-talloc python-tdb rpcbind samba-common samba-common-bin
  samba-dsdb-modules samba-libs smbclient snmp

Can someone help me to understand why does apt want to install for example gnupg?

Looking at the recommended packages:

Recommends: bind9-host | host, dnsutils, libnet-snmp-perl, rpcbind, smbclient, snmp, sudo, libdbi1 (>= 0.8.4), libgnutls30 (>= 3.6.5), libldap-2.4-2 (>= 2.4.7), libmariadb3 (>= 3.0.0), libpq5, libradcli4, zlib1g (>= 1:1.1.4)

I can't understand which exact package forces gnupg installation. Can someone explain me additional packages installation logic with gnupg package as example? Thanks.

jordanm
  • 42,678
Rimvydas
  • 377
  • 4
  • 14

2 Answers2

19

aptitude can tell you:

$ aptitude why monitoring-plugins-standard gnupg
p   monitoring-plugins-standard Recommends smbclient
i A smbclient                   Depends    samba-common (= 2:4.9.5+dfsg-5+deb10u1)
i A samba-common                Recommends samba-common-bin
i A samba-common-bin            Recommends samba-dsdb-modules
i A samba-dsdb-modules          Depends    libgpgme11 (>= 1.2.0)
i A libgpgme11                  Recommends gpgsm
i A gpgsm                       Recommends gnupg (= 2.2.12-1+deb10u1)

This works even if none of the packages are installed.

Stephen Kitt
  • 434,908
4

Stephen's answer tells you how to find out why. Expanding on this, if you don't want gnupg installed, you can prevent that from happening.

Debian packages know several dependency relations, amongst others:

  • a depends b: package b must be installed.
  • a recommends b: package b is optional but recommended. They are installed by default.
  • a suggests b: package b may be useful, but is not installed by default.

Since gnupg is recommended (at several points in the chain even), you don't have to install it. You can tell apt this by adding gnupg to the install command, but appending a -. Alternatively, you can skip all recommended packages by using --no-install-recommends (for aptitude: --without-recommends).

Default:

# apt install monitoring-plugins-standard
Suggested packages:
  dbus-user-session pinentry-gnome3 tor rblcheck parcimonie xloadimage scdaemon lrzip
  cups-common libcrypt-des-perl libdigest-hmac-perl libio-socket-inet6-perl lm-sensors
  snmp-mibs-downloader icinga | icinga2 fping qstat pinentry-doc python-crypto-doc
  heimdal-clients cifs-utils
The following NEW packages will be installed:
  dirmngr dnsutils gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client
  gpg-wks-server gpgconf gpgsm libarchive13 libassuan0 libavahi-client3
  libavahi-common-data libavahi-common3 libcups2 libdbi1 libgpgme11 libirs161 libjansson4
  libksba8 libldb1 libnet-snmp-perl libnpth0 libpq5 libradcli4 libsensors-config
  libsensors5 libsmbclient libsnmp-base libsnmp30 libtalloc2 libtdb1 libtevent0
  libwbclient0 monitoring-plugins-basic monitoring-plugins-common
  monitoring-plugins-standard pinentry-curses python-crypto python-gpg python-ldb
  python-samba python-talloc python-tdb rpcbind samba-common samba-common-bin
  samba-dsdb-modules samba-libs smbclient snmp sudo
0 upgraded, 54 newly installed, 0 to remove and 1 not upgraded.
Need to get 25.7 MB of archives.
After this operation, 85.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Excluding gnupg:

# apt install monitoring-plugins-standard gnupg- 
Suggested packages:
  dbus-user-session pinentry-gnome3 tor rblcheck scdaemon lrzip cups-common
  libcrypt-des-perl libdigest-hmac-perl libio-socket-inet6-perl lm-sensors
  snmp-mibs-downloader icinga | icinga2 fping qstat pinentry-doc python-crypto-doc
  heimdal-clients cifs-utils
Recommended packages:
  gnupg
The following NEW packages will be installed:
  dirmngr dnsutils gpg gpg-agent gpg-wks-client gpgconf gpgsm libarchive13 libassuan0
  libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libdbi1 libgpgme11
  libirs161 libjansson4 libksba8 libldb1 libnet-snmp-perl libnpth0 libpq5 libradcli4
  libsensors-config libsensors5 libsmbclient libsnmp-base libsnmp30 libtalloc2 libtdb1
  libtevent0 libwbclient0 monitoring-plugins-basic monitoring-plugins-common
  monitoring-plugins-standard pinentry-curses python-crypto python-gpg python-ldb
  python-samba python-talloc python-tdb rpcbind samba-common samba-common-bin
  samba-dsdb-modules samba-libs smbclient snmp sudo
0 upgraded, 50 newly installed, 0 to remove and 1 not upgraded.
Need to get 22.6 MB of archives.
After this operation, 77.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Excluding smbclient (which is what pulls in gnupg):

# apt install monitoring-plugins-standard smbclient-
Suggested packages:
  rblcheck libcrypt-des-perl libdigest-hmac-perl libio-socket-inet6-perl lm-sensors
  snmp-mibs-downloader icinga | icinga2 fping qstat
Recommended packages:
  smbclient
The following NEW packages will be installed:
  dnsutils libdbi1 libirs161 libnet-snmp-perl libpq5 libradcli4 libsensors-config
  libsensors5 libsnmp-base libsnmp30 monitoring-plugins-basic monitoring-plugins-common
  monitoring-plugins-standard rpcbind snmp sudo
0 upgraded, 16 newly installed, 0 to remove and 1 not upgraded.
Need to get 6,904 kB of archives.
After this operation, 17.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Excluding all recommends:

# apt install --no-install-recommends monitoring-plugins-standard 
Suggested packages:
  icinga | icinga2 fping qstat
Recommended packages:
  dnsutils libnet-snmp-perl rpcbind smbclient snmp sudo libdbi1 libpq5 libradcli4
The following NEW packages will be installed:
  monitoring-plugins-basic monitoring-plugins-common monitoring-plugins-standard
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 522 kB of archives.
After this operation, 3,088 kB of additional disk space will be used.
Do you want to continue? [Y/n]

(apt output slightly redacted for brevity)

marcelm
  • 2,485