117

I started using GNU Privacy Guard. An error occurs when trying to import a key from any server:

gpg --keyserver keys.gnupg.net --recv-key 908F435E

Output:

gpg: keyserver receive failed: No name
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Erf
  • 1,223
  • 3
  • 5
  • 5

6 Answers6

175

I stumbled upon this today and found the fix at Maven Central Repository Documentation. The SKS Keyserver Network is being deprecated and probably gone by now. Just use another GPG key server like:

  • keyserver.ubuntu.com
  • keys.openpgp.org
  • pgp.mit.edu

So for example

gpg --keyserver keyserver.ubuntu.com --recv-key 908F435E
Dharman
  • 30,962
  • 25
  • 85
  • 135
Jacob van Lingen
  • 8,989
  • 7
  • 48
  • 78
  • 4
    Curious. I am getting the same error as the OP, but this doesn't fix it to me. The error message changes from "No name" to "No data" though. – Jeroen van der Meer Jun 29 '21 at 09:22
  • 2
    @JeroenvanderMeer That probably indicates the key itself does not exist on the server. To add a key to the keyserver use `gpg --keyserver --send-keys ` – Jacob van Lingen Jun 29 '21 at 09:35
  • 1
    That appears to give the same error, regardless of the choice of key server. Hmm, but let me not digress from the topic of this thread too much --- I'll see what I can do. – Jeroen van der Meer Jun 29 '21 at 09:57
  • 1
    If that's not working, e.g. due to a firewall, you could also try it with `hkp://keyserver.ubuntu.com:80` – mYnDstrEAm Jan 12 '22 at 00:19
28

Try these command one by one. It works for me.

curl -sSL https://rvm.io/mpapis.asc | gpg2 --import
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Waseem Anwar
  • 289
  • 3
  • 4
  • 4
    I don't know if this problem is specific from `rvm`, but this one actually works. Trying hkp://keys.openpgp.org hkp://pgp.mit.edu hkp://keyserver.pgp.com hkp://keyserver.ubuntu.com does not work "gpgkeys: key ... can't be retrieved" – Andy Aug 03 '21 at 23:23
5

As an alternative to the options above, from the RVM security documentation,

If you encounter problem with the key server above, try a different one. Some alternatives are presented below:

  • hkp://ipv4.pool.sks-keyservers.net
  • hkp://pgp.mit.edu
  • hkp://keyserver.pgp.com

The second one worked for me, hkp://pgp.mit.edu

2

Replace $key with the corresponding $key you want to add.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $key

This works on Ubuntu 20.04 (Focal Fossa).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

Please use these commands one by one:

curl -sSL https://rvm.io/mpapis.asc | gpg --import -

curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -

Or you can refer to the rvm.io.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Aaquib Jawed
  • 485
  • 4
  • 11
  • This seems to be a plagiarised version of [Waseem Anwar's answer](https://stackoverflow.com/questions/66217436/error-gpg-keyserver-receive-failed-no-name/68152078#68152078). The sentence content, sentence structure, and command lines are nearly identical. – Peter Mortensen Aug 19 '22 at 16:10
  • Actually i have added this answer before that but someone deleted my answer and don't know why...! – Aaquib Jawed Aug 19 '22 at 18:54
-5

keys.gnupg.net is just an alias to pool.sks-keyservers.net. You can point directly to this second address and it will work.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • @MiguelConde See one of the other answers. It seems that these servers do not exist anymore. You should use other server names. – ASdeL Jul 12 '21 at 17:46