升级 mysql.list 文件后如何修复 apt update?

升级 mysql.list 文件后如何修复 apt update?

在通过 VirtualBox 将 Ubuntu Desktop 20.04 升级到 22.04 之后focal-jammy/etc/apt/sources.list.d目录中存在该mysql.list文件。

根据研究表明打开该文件并将从更改为localjammy因此我现在有

### 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$ 

现在,当执行sudo apt update命令时,会发生以下情况:

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.

你可以看到有很多错误

升级 mysql.list 文件后如何修复 apt update?

答案1

已答复之前。您唯一需要更改的是所报告的公钥。

以下命令是解决方案:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C 

相关内容