Reputation: 172
I really hope you can help me as i've tried to find a solution myself for like 3 hours or so. I basically went through every stackoverflow post there was regarding this.
What i'm trying to do is i want to apt-get update
on my Debian Linux 10 environment.
Every time i try to run this this comes up:
Get:1 http://repo.mysql.com/apt stable InRelease [3,566 B]
Get:2 https://packages.sury.org/php buster InRelease [6,771 B]
Err:1 http://repo.mysql.com/apt stable InRelease
The following signatures were invalid: A4A9406876FCBD3C456770C88C718D3B5072E1F5
Get:3 https://packages.sury.org/php buster/main i386 Packages [282 kB]
Reading package lists... Done
W: GPG error: http://repo.mysql.com/apt stable InRelease: The following signatures were invalid:
A4A9406876FCBD3C456770C88C718D3B5072E1F5
E: The repository 'http://repo.mysql.com/apt stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I have tried everything i found on stackoverflow and on the MySQL forum. I really hope you can help me.
Thanks in advance.
Upvotes: 21
Views: 52334
Reputation: 124
None of the answers provided worked for me. I'm running Ubuntu 20.04.6 LTS, but I need to run MySQL 5.7. This was possible using an older mysql-apt-config (0.8.24-1). See https://askubuntu.com/questions/1232558/install-mysql-5-7-on-ubuntu-20-04 - the post mentions 0.8.10, but it works up to 0.8.24.
After October 2023, this method will not work because the PGP key used is not public or has been forgotten to be published.
However, you can manually import the PGP key:
wget -qO - https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | sudo apt-key add -
(see https://repo.mysql.com/ for a list of available keys, choose the most recent one)
After that, apt-get update
works again, however mysql-apt-config was updated to the latest version in the process. I had to remove it and re-install mysql-apt-config_0.8.24-1_all.deb from my local copy.
Upvotes: 5
Reputation: 135
try this
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B7B3B788A8D3785C
Upvotes: 9
Reputation: 81
Considering that the mysql-server on your machine is installed through APT repositories, you can solve this problem by installing MySQL's APT configurator.
Apparently, the GPG key is reconfigured once mysql-apt-config.deb
is installed.
Resources: upgrading mysql though APT repositories
Upvotes: 7
Reputation: 421
Was getting similar error
Err:2 http://repo.mysql.com/apt/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
Fetched 20.0 kB in 1s (26.1 kB/s)
Try to remove the previous key and add it again:
$ sudo apt-key list
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2021-12-14 [SC] [expires: 2023-12-14]
859B E8D7 C586 F538 430B 19C2 467B 942D 3A79 BD29
uid [ unknown] MySQL Release Engineering <[email protected]>
sub rsa4096 2021-12-14 [E] [expires: 2023-12-14]
sudo apt-key del A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 467B942D3A79BD29
After that sudo apt-get update
is working fine.
Upvotes: 32
Reputation: 1271
I just had a similar problem and found an answer here. The signature key expired.
Try running the following command:
sudo apt-key adv --keyserver keys.gnupg.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
Upvotes: 3