To fix an error message like
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXX
on Ubuntu run the command
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys XXX
(replace XXX with the key id that is missing). Note that by doing so you trust this key and any software packages that are signed with this key. This is a possible security risk.