[HOW TO] Fix NO_PUBKEY error

Sometimes a manually added PPA could cause update error which looks like below during the update:

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXX

This can be fixed by issuing the following 2 commands in terminal:

gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv XXXXXXXXXX

gpg --export --armor XXXXXXXXXX | sudo apt-key add -

10 Likes

apt-key is deprecated and this fix is no longer recommended. see this post on stackoverflow for the new solution, which should hopefully work for most people even though it didn't work in my case.

Yes, apt-key is now deprecated, however the commands should (and do for most) still work on Z16 and 17, based on 20.04 and 22.04 respectively. The apt-key application is being phased out, rather than dropped outright.