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
If you get this error while installing a Ubuntu package, you must have added a package in the apt repository before but it is not able to verified the signature as public key is not available. Here is the solution for you.
There must be a key after the text 'NO_PUBKEY' in the error, copy the key and run the command
Here use the key in the command instead of <PUBKEY>
Your command should be like
Now try to install the package again, you should not get above error again.
If you get this error while installing a Ubuntu package, you must have added a package in the apt repository before but it is not able to verified the signature as public key is not available. Here is the solution for you.
There must be a key after the text 'NO_PUBKEY' in the error, copy the key and run the command
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <PUBKEY>
Here use the key in the command instead of <PUBKEY>
Your command should be like
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C
Now try to install the package again, you should not get above error again.