Ubuntu中apt-get update报密钥错误

1. 错误提示

在Ubuntu中,执行apt-get update时,报错!

root@c86b:/# apt-get update && apt-get install vim
Get:1 http://repo.mysql.com/apt/debian buster InRelease [22.1 kB]
Err:1 http://repo.mysql.com/apt/debian buster InRelease                                                                                   
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
Get:2 http://security.debian.org/debian-security buster/updates InRelease [34.8 kB]                    
Get:3 http://deb.debian.org/debian buster InRelease [122 kB]                     
Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [433 kB]
Get:5 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]                                                                                                                                                                                               
Get:6 http://deb.debian.org/debian buster/main amd64 Packages [7909 kB]                                                                                                                                                                                             
Get:7 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]                                                                                                                                                                                      
Reading package lists... Done                                                                                                                                                                                                                                       
W: GPG error: http://repo.mysql.com/apt/debian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29
E: The repository 'http://repo.mysql.com/apt/debian buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

备注:主要看到了 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY

2. 解决办法

(1)重新生成该ID的公钥

# 在root权限下,或者在普通用户中使用 sudo 操作
gpg --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29

(2)将公钥添加到本机的密钥中

gpg --export --armor 467B942D3A79BD29 | sudo apt-key add -

(3)执行apt-get update,成功!

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值