17

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.

RootK1d
  • 171
  • 1
  • 1
  • 7
  • I had to install MySQL on Ubuntu through a different method: https://askubuntu.com/questions/1259242/unable-to-install-mysql-5-7-on-ubuntu-20-04 – GDP2 Feb 01 '22 at 08:58

2 Answers2

23

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 <mysql-build@oss.oracle.com>
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.

user59621
  • 331
  • 2
  • 2
  • 5
    +1 because your answer was part of the solution. However, for deleting the key, you'll have to put it in quotes because of the space characters. For example: `sudo apt-key del 'A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5'` – Binarus Mar 30 '22 at 09:20
  • 2
    Just worked without quotes for me? – Giles Bennett Oct 26 '22 at 07:35
3

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

PW_Parsons
  • 1,173
  • 2
  • 12
  • 19
  • 1
    When i try that this comes back: `Executing: /tmp/apt-key-gpghome.00F6EFHTL2/gpg.1.sh --keyserver keys.gnupg.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 gpg: key 8C718D3B5072E1F5: 3 duplicate signatures removed gpg: key 8C718D3B5072E1F5: "MySQL Release Engineering " not changed gpg: Total number processed: 1 gpg: unchanged: 1 ` And then apt-get update still doesn't work. – RootK1d Mar 02 '21 at 15:31
  • 1
    @RootK1d I'm getting the same error as you with the `unchanged: 1` and the update doesn't work. were you able to find a solution? – dude8998 Feb 19 '22 at 00:48