Gpg: keyserver receive failed: No dirmngr error - How to fix it?

I run gpg --recv-key key and getting gpg: keyserver receive failed: No dirmngr. Here is full output:

gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/root/.gnupg/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr

How to fix gpg: keyserver receive failed: No dirmngr on Linux?

To fix this problem search and install dirmngr as follows:

  1. Search for dirmngr package on your Linux:
apt search dirmngr # Debian/Ubuntu 
zypper search dirmngr # SUSE/OpenSUSE
  1. Then install it as the root user:
sudo apt install dirmngr # Debian/Ubuntu 
sudo zypper install dirmngr # SUSE/OpenSUSE
Loading repository data...

Reading installed packages...
Resolving package dependencies...

The following 4 NEW packages are going to be installed:
  dirmngr libgnutls30 libhogweed4 libnettle6

4 new packages to install.
Overall download size: 1.4 MiB. Already cached: 0 B. After the operation,
additional 3.5 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package libnettle6-3.4.1-4.18.1.x86_64
                                          (1/4), 211.7 KiB (702.4 KiB unpacked)
Retrieving: libnettle6-3.4.1-4.18.1.x86_64.rpm .............[done (16.3 KiB/s)]
Retrieving package libhogweed4-3.4.1-4.18.1.x86_64
                                          (2/4), 152.1 KiB (223.9 KiB unpacked)
Retrieving: libhogweed4-3.4.1-4.18.1.x86_64.rpm .........................[done]
Retrieving package libgnutls30-3.6.7-14.13.5.x86_64
                                          (3/4), 714.4 KiB (  1.7 MiB unpacked)
Retrieving: libgnutls30-3.6.7-14.13.5.x86_64.rpm ........................[done]
Retrieving package dirmngr-2.2.27-1.2.x86_64
                                          (4/4), 365.0 KiB (891.0 KiB unpacked)
Retrieving: dirmngr-2.2.27-1.2.x86_64.rpm ...............................[done]

Checking for file conflicts: ............................................[done]
(1/4) Installing: libnettle6-3.4.1-4.18.1.x86_64 ........................[done]
(2/4) Installing: libhogweed4-3.4.1-4.18.1.x86_64 .......................[done]
(3/4) Installing: libgnutls30-3.6.7-14.13.5.x86_64 ......................[done]
(4/4) Installing: dirmngr-2.2.27-1.2.x86_64 .............................[done]
  1. Finally, run the gpg command again:
gpg --recv-key key
1 Like

Now my gpg command working.


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki