Apt-get: Public GNUPG key not imported

By xngo on April 6, 2020

I got the following error message when I was trying to update my repositories.

apt-get update
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A03BE326C0EF29A4

Solution

gpg -q --output my-public.key --armor --export "A03BE326C0EF29A4"
cat my-public.key | apt-key add -
 
# Or you can import using gpg.
cat my-public.key | gpg --no-default-keyring --keyring /etc/apt/trusted.gpg --import

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.