13

After to did do an upgrade through VirtualBox for Ubuntu Desktop 20.04 to 22.04 - focal to jammy - at the /etc/apt/sources.list.d directory exists the mysql.list file.

According with a research was indicated to open that file and change from local to jammy. Therefore I have now

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out entries below, but any other modifications may be lost.
# Use command 'dpkg-reconfigure mysql-apt-config' as root for modifications.
deb http://repo.mysql.com/apt/ubuntu/ jammy mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ jammy mysql-8.0
deb http://repo.mysql.com/apt/ubuntu/ jammy mysql-tools
#deb http://repo.mysql.com/apt/ubuntu/ jammy mysql-tools-preview
deb-src http://repo.mysql.com/apt/ubuntu/ jammy mysql-8.0
manueljordan@mac2013-vb143:/etc/apt/sources.list.d$ 

Now when is executed the sudo apt update command happens the following:

sudo apt update
Get:1 http://repo.mysql.com/apt/ubuntu jammy InRelease [20.2 kB]
Hit:2 https://download.docker.com/linux/ubuntu focal InRelease                                                                       
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease                                                                        
Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease    
Hit:5 http://pe.archive.ubuntu.com/ubuntu jammy InRelease
Hit:6 http://pe.archive.ubuntu.com/ubuntu jammy-updates InRelease
Err:1 http://repo.mysql.com/apt/ubuntu jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
Hit:7 http://pe.archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 20.2 kB in 2s (11.7 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
16 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/jammy/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
W: Some index files failed to download. They have been ignored, or old ones used instead.

As you can see there are many errors

How to fix apt update after to upgrade the mysql.list file?

Manuel Jordan
  • 1,768
  • 7
  • 30
  • 50
  • It's REALLY annoying that questions like this keep getting closed. They don't have answers that work consistently, and claiming they do is akin to religious faith... The only way I was able to get this working was by (re)installing the apt setup package from the Oracle site - https://dev.mysql.com/downloads/repo/apt/ – AntonOfTheWoods Jan 13 '24 at 02:14
  • The answer(s) worked in peace ... – Manuel Jordan Jan 15 '24 at 16:09

1 Answers1

10

Has been answered previously. The only thing you need to change is the reported public key.

The following command was the solution there:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C 
andrew.46
  • 38,003
  • 27
  • 156
  • 232
helonaut
  • 132
  • And the referred link was posted by myself time ago :) - yes the following command was the solution sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C – Manuel Jordan Dec 15 '23 at 15:20
  • 5
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C did not help in my case, i also needed to update /etc/apt/keyrings/mysql.gpg with gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B7B3B788A8D3785C && rm /etc/apt/keyrings/mysql.gpg && gpg --output /etc/apt/keyrings/mysql.gpg --export B7B3B788A8D3785C because i was still getting the same errors as in the original post – bigbear3001 Dec 19 '23 at 15:14
  • @bigbear3001 interesting your situation ... – Manuel Jordan Dec 19 '23 at 22:08
  • @bigbear3001, I have the same situation, but even replacing this file doesn't fix it. been trying with apt-key export & gpg dearmour, but nothing so far... – Steven Van Ingelgem Jan 24 '24 at 14:33
  • @StevenVanIngelgem do you have a key specified in your /etc/apt/sources.list.d/... file? i think i needed to replace the file mentioned in deb [signed-by=/etc/apt/keyrings/mysql.gpg ... because adding it to the general keyring does not help if the sources list file specifies a special key file. – bigbear3001 Jan 25 '24 at 07:49
  • Thanks @bigbear3001! That was it. I installed mysql via "mysql-apt-config", and this installs a key under /usr/share/keyrings/mysql-apt-config.gpg. So moving the key I made under /etc/apt/trusted.gpg.d/mysql.gpg to that location fixed the "NO_PUBKEY" error. – Steven Van Ingelgem Jan 25 '24 at 11:07
  • Another alternative apt-key --keyring /etc/apt/keyrings/mysql.gpg adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C or gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B7B3B788A8D3785C && gpg --export B7B3B788A8D3785C > /etc/apt/keyrings/mysql.gpg – xpuu Feb 15 '24 at 21:01
  • hkp:// and port :80 are needed. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B7B3B788A8D3785C More info: https://unix.stackexchange.com/questions/399027/gpg-keyserver-receive-failed-server-indicated-a-failure/399091#399091 – Emil Carpenter Mar 07 '24 at 10:39