How to fix missing dirmngr

Debian Stretch provides gnupg in minimal installation as the package priority is set to important. The command is fully operational, but it requires dirmngr to perform network operations for managing and downloading certificates.

It is easy to spot missing dirmngr, just look at the last line.

$ apt-key adv --keyserver keyring.debian.org --recv-keys 0x1827364554637281
Executing: /tmp/apt-key-gpghome.jm0CXrmSHQ/gpg.1.sh --keyserver keyring.debian.org --recv-keys 0x1827364554637281
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.jm0CXrmSHQ/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr

Install dirmngr using the following command.

$ sudo apt-get install dirmngr --install-recommends

Now gnupg will gain network functionality.

$ apt-key adv --keyserver keyring.debian.org --recv-keys 0x1827364554637281
Executing: /tmp/apt-key-gpghome.KIs5UQwJrh/gpg.1.sh --keyserver keyring.debian.org --recv-keys 0x1827364554637281
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

Why dirmngr package is not installed by default?

It is marked as an optional and recommended for gnupg. Decision behind this is described in bug report #845720 gnupg: missing dependency on dirmngr as follows:

gnupg already Recommends: dirmngr.  Without dirmngr, the gnupg package
can perform all sorts of useful functionality (encryption, decryption,
signing, verification, local key management, etc).  The only thing it
needs dirmngr for is network access.

ยง7.2 of policy says of Recommends:

     This declares a strong, but not absolute, dependency.

     The Recommends field should list packages that would be found
     together with this one in all but unusual installations.


and of Depends:

     This declares an absolute dependency. A package will not be
     configured unless all of the packages listed in its Depends field
     have been correctly configured (unless there is a circular
     dependency as described above).

     The Depends field should be used if the depended-on package is
     required for the depending package to provide a significant amount
     of functionality.

I'm closing this bug report because dirmngr fits much better in
Recommends than in Depends.

           --dkg

Everything is fine.

Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system. He is also open for new opportunities and challenges.

Gdansk, Poland https://sleeplessbeastie.eu