Fix asdf vm gpg: keyserver receive failed: Network is unreachable error

Fix asdf Nodejs GPG keyeserver receive failed solution

Error code:

> asdf install nodejs latest
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3690    0  3690    0     0   8348      0 --:--:-- --:--:-- --:--:--  8348
gpg: keyserver receive failed: Network is unreachable
gpg: keyserver receive failed: No keyserver available

Solution

echo "standard-resolver" >  ~/.gnupg/dirmngr.conf

sudo pkill dirmngr

And try reinstall again, everything should be work as expected.

❯ asdf install nodejs lts
Installing alias lts as 14.18.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3835    0  3835    0     0  42142      0 --:--:-- --:--:-- --:--:-- 42142
gpg: key D7062848A1AB005C: public key "Beth Griggs <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key 7434390BDBE9B9C5: public key "Colin Ihrig <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key D3A89613643B6201: public key "Danielle Adams <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key C97EC7A07EDE3FC1: public key "keybase.io/jasnell <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key 770F7A9A5AE15600: public key "Michaël Zasso (Targos) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key E73BC641CC11F4C8: public key "Myles Borins <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key C43CEC45C17AB93C: public key "Richard Lau <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key C273792F7D83545D: public key "Rod Vagg <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key F07496B3EB3C1762: public key "Ruben Bridgewater <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key 97B01419BD92F80A: public key "Ruy Adorno <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: key F13993A75599653C: public key "Shelley Vohr (security is major key) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 30.6M  100 30.6M    0     0  8804k      0  0:00:03  0:00:03 --:--:-- 8804k
node-v14.18.0-darwin-x64.tar.gz: OK
Linking "lts" to "14.18.0"

Refenreces

  1. https://github.com/asdf-vm/asdf-nodejs/issues/192#issuecomment-797448073