Err:4 http://repo.mysql.com/apt/ubuntu focal InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29

修复 apt-get update “以下签名无法验证,因为公钥不可用”

tang@tang-virtual-machine:~$ sudo apt update Hit:1 http://mirrors.aliyun.com/ubuntu focal InRelease Get:2 http://packages.microsoft.com/repos/code stable InRelease [10.4 kB] Hit:3 http://mirrors.aliyun.com/ubuntu focal-security InRelease Get:4 http://repo.mysql.com/apt/ubuntu focal InRelease [12.9 kB] Hit:5 https://packages.microsoft.com/repos/vscode stable InRelease Hit:6 http://mirrors.aliyun.com/ubuntu focal-updates InRelease Hit:7 https://packages.microsoft.com/repos/edge stable InRelease Hit:8 http://mirrors.aliyun.com/ubuntu focal-backports InRelease Hit:9 http://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease Hit:10 https://dl.google.com/linux/chrome/deb stable InRelease Get:11 http://packages.microsoft.com/repos/code stable/main armhf Packages [108 kB] Hit:12 http://security.ubuntu.com/ubuntu focal-security InRelease Get:13 http://packages.microsoft.com/repos/code stable/main amd64 Packages [107 kB] Get:14 http://packages.microsoft.com/repos/code stable/main arm64 Packages [108 kB] Ign:15 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 InRelease Err:4 http://repo.mysql.com/apt/ubuntu focal InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29 Hit:16 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 Release Fetched 347 kB in 1s (245 kB/s)

如果不修复这些错误,apt 在安装或升级软件包时会出现问题。例如:

7 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 focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29 W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/focal/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29 W: Some index files failed to download. They have been ignored, or old ones used instead.

apt 打包系统具有一组受信任的密钥,这些密钥确定一个包是否可以通过身份验证并因此被信任安装在系统上。有时系统没有所需的所有密钥并遇到此问题。幸运的是,有一个快速修复。每个被列为缺失的密钥都需要添加到 apt 密钥管理器中,以便它可以对包进行身份验证。

查看上面的错误,apt 告诉我们缺少以下键:467B942D3A79BD29. 请注意,这些被多次列出。每个唯一键只需要添加一次。

要添加这些键,请运行以下命令:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29

posted @ 2022-09-10 11:00  Xingtxx  阅读(394)  评论(0编辑  收藏  举报