A few times I have gambled with online scripts while working on a server. Recently (today actually) I wanted to upgrade my PHP version from 7.0 to 7.1. After trying out the normal upgrade command, it didn’t work.
A few minutes of Googling and I completely messed up my server… not like the server went down or anything, but I get these weird error messages at the end of sudo apt-get update && sudo apt-get upgrade something like:
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 4F4EA0AAE5267A6C
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.`
I hate having those!
Anyways, this is how I solved it:
- Install PPA Purge :
sudo apt-get install -y ppa-purge
- Run normal server package update
sudo apt-get update
- Then begin using it, for me, what Iinstalled was ppa:ondrej/php to use ppa-purge, just do:
ppa-purge [package name]
So for me, i did:
ppa-purge ppa:ondrej/php
And, that took care of it. Of course, you might need sudo.
The main work might be trying to trace out the specific package you installed that caused the weird error. Luckily, most of the time, the weird error does provide some debugging tips. Like, for me:
http://ppa.launchpad.net/ondrej/php/ubuntu
That’s it. 🙂