admin管理员组

文章数量:1592245

使用apt update时候报以下错误

MySQL APT 存储库:签名验证期间发生错误(公钥不可用)

MySQL为社区版本的MySQL 运行自己的包存储库。它们支持yumapt包管理器,但之前的 GPG(用于签署包)已被替换。这会在运行apt-get update时导致错误:

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/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/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 gpg 密钥。这些文件通常以 .gpg、.gnupg、.key 或类似的后缀结尾。在存储库的顶级目录中发现一个文件:RPM-GPG-KEY-mysql-2022

坑死了!

为什么坑爹?因为文件以 RPM 开头,大家肯定以为这个Key只用于 rpm 包(用于 yum 包管理器)

使用 apt-key 导入该文件:

curl -s http://repo.mysql/RPM-GPG-KEY-mysql-2022 | apt-key add -

好的 我们执行apt update

apt update

成功!

因此它是 GPG 密钥,所以它是有效的。虽然名字叫 RPM-GPG-KEY-mysql-2022 有点坑,但它确实是 MySQL APT 存储库的正确密钥

本文标签: 解决方法错误Errormysqlapt