[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.

Is there a replacement method for Zorin 18 on this thread? I have this issue on 18.1 Pro and am wary of doing the above if it's not an 18- solution. Thanks!

The link in @deerdrop's post provides a working method.

That said, the method in the Original Post will work; it is just not preferred. The apt-key add command was deprecated because it adds the keys globally.
I think if you run the command, you will get a warning that says as much.

1 Like