"GPG error:The following signatures were invalid: KEYEXPIRED"

I don't get the answers above, my system clock was fine. The following worked for me:

sudo apt-key list | grep "expired: "
sudo apt-key adv --keyserver keys.gnupg.net --recv-keys [KEY]

The key being the the part behind the slash: 0000X/<this part is the key>

Or use this one liner:

sudo apt-key list  | grep "expired: " | sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | xargs -n1 sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 

As simple as this should work:

sudo apt-key adv --refresh-keys

Why use sed and xargs if gpg can sort things for itself?

If getting an error about inaccessible key servers, try setting one directly:

sudo apt-key adv --keyserver hkps://keyserver.ubuntu.com --refresh-keys

GPG error: http://download.opensuse.org ./ Release: The following signatures were invalid: KEYEXPIRED 1436387333

This says that your GPG key for that repository has expired, which means one of two things, either your system has the wrong date or the key really expired. For the later, you need to contact the repository maintainer and import the new key (removing the old one, probably), once the repository updates their keys to sign the files.

You can safely ignore these messages if you aren't using packages of these repositories. The message can be removed if you remove the repository from your source.list file/directory.

Tags:

Apt