修复 Debian 因缺少公钥而无法更新源的问题

有时候重新安装 Debian 系统之后,在运行 apt update 更新源的时候可能会遇到,没有公钥且无法验证签名,这种错误错误,简单纪录一下解决的方法。

错误提示:

root@vps:~# apt update
Get:1 http://security.debian.org wheezy/updates Release.gpg [1571 B]
Get:2 http://security.debian.org wheezy/updates Release [102 kB]
Get:3 http://ftp.debian.org wheezy Release.gpg [2390 B]
....
Reading package lists... Done
W: There is no public key available for the following key IDs:
9D6D8F6BC857C906
W: There is no public key available for the following key IDs:
7638D0442B90D010
W: There is no public key available for the following key IDs:
7638D0442B90D010

网上查了一下,得知原因是由该源对应的公钥没有导入导致的,解决办法如下:

apt install debian-keyring debian-archive-keyring -y

然后再更新源和软件:
apt update && apt upgrade

标签: Debian

发表评论: