apt update 最后报错
$ sudo apt update
报错
......
91 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
重点:
NO_PUBKEY 467B942D3A79BD29
缺少公钥?
重新获取公钥并加入到 apt 信任密钥
-
获取 gpg 公钥
$ sudo gpg --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
gpg: key 467B942D3A79BD29: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
重复执行多次不会改变,也不影响
$ sudo gpg --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
gpg: key 467B942D3A79BD29: "MySQL Release Engineering <mysql-build@oss.oracle.com>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
-
导出公钥,加入到 apt 信任密钥
$ sudo gpg --export --armor 467B942D3A79BD29 | sudo apt-key add -
OK
-
再来 update
$ sudo apt update
......
Reading package lists... Done
Building dependency tree
Reading state information... Done
98 packages can be upgraded. Run 'apt list --upgradable' to see them.
不再报错了!
4 确认:查询一下被信任密钥
$ apt-key list
......
pub rsa4096 2021-12-14 [SC] [expires: 2023-12-14]
859B E8D7 C586 F538 430B 19C2 467B 942D 3A79 BD29
uid [ unknown] MySQL Release Engineering <mysql-build@oss.oracle.com>
sub rsa4096 2021-12-14 [E] [expires: 2023-12-14]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)