The MySQL repository key has suddenly expired again, so I get a GPG error in Ubuntu when running apt-get update
The error is W: GPG error: http://repo.mysql.com/apt/ubuntu xenial InRelease: The following signatures were invalid: KEYEXPIRED 1550412832 KEYEXPIRED 1550412832 KEYEXPIRED 1550412832
TLDR; The one-liner that fixes this is the following:
Which basically fetches the new key and installs it into the keyring.
A bit more detail:
You can find the expired key by executing the following command:
LANG=C apt-key list | grep expired
Which outputs something like this:
pub 1024D/5072E1F5 2003-02-03 [expired: 2019-02-17]
5072E1F5 is the key ID, which we used in the command above.Another one-liner that's recommended in the bug report below is this one:
But I couldn't get it to work.
More reading from when this happened the last time.
https://bugs.mysql.com/bug.php?id=85029
This issue has been raised to MySQL already Bug#94378.
You can try this workaround.