- Published on
Fix The following signatures couldn't be verified because the public key is not available on Ubuntu 16.04 (Xenial)
If you terminal looks like this after running apt-get update :
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO\_PUBKEY {whatever}
W: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
You will be tempted to use apt-key or add-apt-key to fix this issue.
In my case (and in most cases if you are using ondrej ppa for PHP7), this issue can be easily tackled.
# add this ppa
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
# install launchpad-getkeys
sudo apt-get install launchpad-getkeys
# run it
sudo launchpad-getkeys