User avatar
HawaiianPi
Posts: 2908
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

gpg: keyserver receive failed: No dirmngr

Tue Sep 19, 2017 12:34 am

I received the above error while trying to import a signing key. Poked around on google for awhile and it seems apt-key has been deprecated in Stretch, and dirmngr is no longer needed, but none of the sources stating that provided instructions for the proper way to do it now.
From: Julian Andres Klode <[email protected]>

Well, problem solved than. apt-key is basically deprecated this
release cycle, it's not guaranteed to work at all anymore.

The correct way is to install key files into trusted.gpg.d.

The reason for this is that we do not want to depend on gnupg: This
takes a lot of space, and starts a lot of daemons every time we want
to verify some keys.

--
Debian Developer - deb.li/jak | jak-linux.org - free software dev
| Ubuntu Core Developer |

========================================
Alan Franzoni (alanfranz) wrote on 2016-10-19:

This is related to https://bugs.launchpad.net/ubuntu/+sour ... ug/1634464 as well, where the maintainer says the "apt-key adv" is deprecated ("like everything else"). Not easy to understand what's deprecated.

By the way, "gpg --keyserver YYY --recv-key XXX" works 100% in Ubuntu Xenial, with no deprecation or warning whatsoever. It should not break in such unexpected way on Yakkety. It seems a gnupg->gnupg2 migration issue to me; I think that at least for Yakkety dirmngr should be included as a required dependency from gnupg2, a warning on the deprecation of such feature could be issues, then the dirmngr package could be switched to an optional dep LATER.

Even though IMHO such behaviour is still bad. If I do "gpg --help" in ubuntu yakkety, I clearly see the "--recv-keys" option. Then it breaks when using it if dirmngr is not installed. I would not list such option and let the user employ a different command altogether for fetching remote keys, instead: that would be WAY easier.

By the way, PLEASE consider that

"apt-key adv --keyserver ..."

is a VERY widely used and recommended command for installing keys. And some keyservers may not even expose a decent way of fetching public keys without the HKP protocol, making gpg --keyserver "the right choice".

========================================
Seth Arnold (seth-arnold) wrote on 2016-10-19:

"apt-key adv --recv-key" may be common advice but after the introduction of /etc/apt/trusted.gpg.d/ it is also bad advice.

We should definitely edit the apt-key(8) manpage to include the right commands to use to populate /etc/apt/trusted.gpg.d/ instead of adv --recv-key.

Thanks
So rather than:

Code: Select all

apt-key adv --keyserver XXX --recv-keys YYY
or

Code: Select all

gpg --keyserver XXX --recv-keys YYY
What is the proper way to do this in Stretch?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
HawaiianPi
Posts: 2908
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: gpg: keyserver receive failed: No dirmngr

Thu Sep 21, 2017 2:23 am

So no one knows how to import signing keys into Stretch?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

RonR
Posts: 275
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: gpg: keyserver receive failed: No dirmngr

Thu Sep 21, 2017 3:15 am

I ran into a similar problem installing FreePBX on Stretch (on Jessie, everything was fine).

The solution turned out to be simply installing dirmngr:

sudo apt-get install dirmngr

Have you installed dirmngr?

User avatar
HawaiianPi
Posts: 2908
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: gpg: keyserver receive failed: No dirmngr

Thu Sep 21, 2017 4:38 am

No, I haven't installed dirmngr because the developer's comments indicate it is no longer needed, so there must be some other way to properly import keys, but the manpages and other documentation have not been updated, because I can't find any reference other than the commands that generate the error.

This is really frustrating, because all I seem to find with various searches are developers saying that the "old" way is deprecated, but apparently the "new" way is some kind of internal secret that they don't want to share.

I think the real solution might be to go back to Jessie, since Stretch is clearly not ready for primetime yet.

I mean, seriously, how can no one know how to do this?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

cjan
Posts: 619
Joined: Sun May 06, 2012 12:00 am

Re: gpg: keyserver receive failed: No dirmngr

Thu Sep 21, 2017 5:21 am

doing good for me,
sudo apt-key adv --keyserver XXX --recv-keys YYY

User avatar
HawaiianPi
Posts: 2908
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: gpg: keyserver receive failed: No dirmngr

Thu Sep 21, 2017 5:56 am

cjan wrote:
Thu Sep 21, 2017 5:21 am
doing good for me,
sudo apt-key adv --keyserver XXX --recv-keys YYY
Are you running Raspbian Stretch, and Desktop or Lite?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

cjan
Posts: 619
Joined: Sun May 06, 2012 12:00 am

Re: gpg: keyserver receive failed: No dirmngr

Thu Sep 21, 2017 6:19 am

HawaiianPi wrote:
Thu Sep 21, 2017 5:56 am
cjan wrote:
Thu Sep 21, 2017 5:21 am
doing good for me,
sudo apt-key adv --keyserver XXX --recv-keys YYY
Are you running Raspbian Stretch, and Desktop or Lite?
Stretch Desktop, jessie update to stretch.

User avatar
HawaiianPi
Posts: 2908
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: gpg: keyserver receive failed: No dirmngr

Thu Sep 21, 2017 7:10 am

cjan wrote:
Thu Sep 21, 2017 6:19 am
Stretch Desktop, jessie update to stretch.
Ah, well that explains it. It worked fine in Jessie. I was working with Stretch Lite.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

sdrider
Posts: 2
Joined: Sat Apr 27, 2013 11:53 pm

Re: gpg: keyserver receive failed: No dirmngr

Mon Sep 25, 2017 5:24 am

Just ran into this myself, this was the top google hit that came up.

I just freshly installed Rapbian Stretch Lite on a pi3 and am trying to bring up unifi which requires importing a key. I get the same error 'gpg: keyserver receive failed: No dirmngr'.

It looks like from the thread that I can just install dirmngr and be good, so I'll try that next. However just wanted to add to the user feedback that declaring dirmngr the 'old' way and removing it from the default image but not providing a 'new' way of doing it seems pretty broken. Hopefully a kind dev finds this thread and can provide some enlightenment on the new way we should be doing things.

User avatar
HawaiianPi
Posts: 2908
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: gpg: keyserver receive failed: No dirmngr

Wed Sep 27, 2017 9:32 am

sdrider wrote:
Mon Sep 25, 2017 5:24 am
Just ran into this myself, this was the top google hit that came up.

I just freshly installed Rapbian Stretch Lite on a pi3 and am trying to bring up unifi which requires importing a key. I get the same error 'gpg: keyserver receive failed: No dirmngr'.

It looks like from the thread that I can just install dirmngr and be good, so I'll try that next. However just wanted to add to the user feedback that declaring dirmngr the 'old' way and removing it from the default image but not providing a 'new' way of doing it seems pretty broken. Hopefully a kind dev finds this thread and can provide some enlightenment on the new way we should be doing things.
Yea, it looks like dirmngr was not included by default in either Lite or Desktop Raspbian Stretch, but until there are instructions on the "proper" way to import keys, manually installing dirmngr is the simple solution.

I'm still surprised we haven't gotten an answer to this. Aren't there any Raspbian developers checking on the Raspbian section of the forum? :?
I know it's ultimately a Debian issue, but I'm assuming the devs know more than I do.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

David.Stanford
Posts: 1
Joined: Sun Oct 15, 2017 5:02 pm

Re: gpg: keyserver receive failed: No dirmngr

Sun Oct 15, 2017 5:27 pm

I installed dirmanager with

Code: Select all

sudo apt-get install dirmngr
For anyone led to this topic by having problems installing Mono or MonoDevelop run the above command then follow the instructions at this link:

http://www.mono-project.com/download/#d ... n-raspbian

jsglazer
Posts: 1
Joined: Tue Jul 24, 2018 12:58 am

Re: gpg: keyserver receive failed: No dirmngr

Tue Jul 24, 2018 1:04 am

I ran into the same problem trying to install Ansible on a Raspberry Pi 3 Stretch.

Code: Select all

[email protected]:~ $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
Executing: /tmp/apt-key-gpghome.oUnvl2xkVh/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/tmp/apt-key-gpghome.oUnvl2xkVh/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr
Installing dirgngr worked for me too.

add to /etc/apt/sources.list: deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main

Code: Select all

sudo apt-get install dirmngr
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
sudo apt-get update
sudo apt-get install ansible

lynj42
Posts: 1
Joined: Sat Aug 18, 2018 7:13 am

Re: gpg: keyserver receive failed: No dirmngr

Sat Aug 18, 2018 8:00 am

I have a pi+, pi2, pi3 and pi3+ all running stretch.
The pi3+ had update errors - no public key etc. All the others update without errors.
Was unable to get keys because dirmngr wasn't installed, it isn't on the other pis either.
After installing dirmngr all works fine.
Anyone know why only pi3+ is affected?

Return to “Raspbian”