Fix: gpg: keyserver receive failed: no name

The GPG (GNU Privacy Guard) tool is a free and open-source encryption software based on PGP (Pretty Good Privacy). It gives signing services and digital encryption through the PGP standard. While importing the GPG key from the server, the user can face the error “gpg: keyserver receive failed: no name”.

This article will demonstrate the reasons and solutions for the error “gpg: keyserver receive failed: no name” the content for the post is:

Reason: Problem with GPG DNS Client Server

The reason for the error is that key does not exist on the server that can be resolved by changing it to another server:

Solution 1: Change to a Different Server

To resolve this error, use a different server for importing the GPG keys. A few server names are given below:

Keyserver.ubuntu.com
keys.openpgp.org
pgp.mit.edu

Let’s use one of the above servers and try to import the GPG key:

$ gpg --keyserver Keyserver.ubuntu.com --recv-key 908F435E

Now you can see that server error has been resolved.

Solution 2: Import rvm files

If the above solution doesn’t work in your case, you can run the following command one by one to import rvm files:

$ curl -sSL https://rvm.io/mpapis.asc | gpg2 --import
$ curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import

The error will be resolved.

Conclusion

The reason for the error “gpg: keyserver receive failed: no name” is the problem with the keyserver that can be fixed by changing it to another server. Users can use the ”Keyserver.ubuntu.com, ”keys.openpgp.org”, or “pgp.mit.edu” server or import the rvm files using the commands given in the guide. This write-up has illustrated the reason and the solutions for the error “gpg: keyserver receive failed: no name”.