Ubuntu: GPG Error NO_PUBKEY

Import GPG public key

# by default it will search to https://keys.openpgp.org:443
$ gpg --keyserver keyserver.ubuntu.com --receive-keys EB3E94ADBE1229CF

# or search and import
$ gpg --keyserver keyserver.ubuntu.com --search-keys EB3E94ADBE1229CF

If everything goes well, you will get this message

gpg: key EB3E94ADBE1229CF: public key "Microsoft (Release signing) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1

Export your imported key to a file

$ gpg --output EB3E94ADBE1229CF.gpg --export EB3E94ADBE1229CF

Move exported key to correct place

$ sudo mv EB3E94ADBE1229CF.gpg /etc/apt/trusted.gpg.d/

Check if everything goes well

$ sudo apt update

Double check! Your key should be listed here

$ apt-key list

...
/etc/apt/trusted.gpg.d/EB3E94ADBE1229CF.gpg
-------------------------------------------
pub   rsa2048 2015-10-28 [SC]
      BC52 8686 B50D 79E3 39D3  721C EB3E 94AD BE12 29CF
uid           [ unknown] Microsoft (Release signing) <[email protected]>
...


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *