Skip to content

Instantly share code, notes, and snippets.

@xyluz
Created May 21, 2021 13:35
Show Gist options
  • Save xyluz/4eb4f5519c6ecc507815e01253693663 to your computer and use it in GitHub Desktop.
Save xyluz/4eb4f5519c6ecc507815e01253693663 to your computer and use it in GitHub Desktop.
Solved: Weird Ubuntu Server Errors/Warning Messages During Update / Upgrade

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:

  1. Install PPA Purge :

sudo apt-get install -y ppa-purge

  1. Run normal server package update
sudo apt-get update
  1. 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. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment