92

While trying to receive keys in my Debian Stretch server, I get this error:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Executing: /tmp/apt-key-gpghome.4B7hWtn7Rm/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.4B7hWtn7Rm/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr
132

Installing the package dirmngr fixed the error.

user@debian-server:~$ sudo apt-get install dirmngr

Retrying :

user@debian-server:~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
Executing: /tmp/apt-key-gpghome.haKuPppywi/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
gpg: key A6A19B38D3D831EF: public key "Xamarin Public Jenkins (auto-signing) <releng@xamarin.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
  • 3
    Had same problem on Debian 9.4. Installing dirmngr fixed it. – AAAfarmclub Mar 14 '18 at 23:11
  • I got the same error of the OP, but I already have latest gpg installed. – realtebo Aug 2 '18 at 5:04
  • 1
    installing gpg fixed it for me on a Debian 9.3. dirmngr was already installed. – Liviu Chircu Aug 23 '18 at 11:56
  • Same issue on Raspbian 9.8 stretch. Installing dirmngr resolved it. Thanks. – user8675309 Mar 11 at 4:58
7

I wasn't able to get dirmngr to work, but you can also just import the key directly using apt-key add. The GPG public key is often listed at the root of the repo like http://origin-download.mono-project.com/repo/

curl https://origin-download.mono-project.com/repo/xamarin.gpg | sudo apt-key add -
  • 2
    You need to run dirmngr if it's not already running. – please delete me Oct 3 '18 at 19:54
  • dirmngr was running, but still no joy... If the keyserver happens to be keyserver.ubuntu.com then you can access via a browser and search for the public key using the --recv-keys parameter, then simply use apt-key add as per this answer – earcam Mar 18 at 12:22

protected by Community Jan 9 at 21:16

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.