apt mysql 遇到 An error occurred during the signature verification 错误解决方法

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

坑死了!

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

使用 apt-key 导入该文件:

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

好的 我们执行apt update

apt update

成功!

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值