cha*_*aos 10 linux debian gpg apt
所以我有这样的事情:
# apt-get update
Get:1 http://ftp.us.debian.org etch Release.gpg [1032B]
Hit http://ftp.us.debian.org etch Release
(...bunch more of this elided...)
Hit http://ftp.us.debian.org etch/contrib Sources
Fetched 68.8kB in 1s (37.4kB/s)
Reading package lists... Done
W: There is no public key available for the following key IDs:
9AA38DCD55BE302B
W: GPG error: http://ftp.us.debian.org etch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B
W: You may want to run apt-get update to correct these problems
Run Code Online (Sandbox Code Playgroud)
显然我不能跑步apt-get update
是因为有一个问题apt-get
要我跑去apt-get update
解决,这很令人不快。我该如何纠正?
And*_*May 16
尝试执行此操作并再次运行 apt-get:
apt-key update
Run Code Online (Sandbox Code Playgroud)
apt-key 是一个程序,用于管理安全 apt 的 gpg 密钥的密钥环。密钥环保存在文件 /etc/apt/trusted.gpg 中(不要与相关但不是很有趣的 /etc/apt/trustdb.gpg 混淆)。apt-key 可用于显示密钥环中的密钥,以及添加或删除密钥。
有关 Debian wiki 的更多信息:http : //wiki.debian.org/SecureApt
如果这不起作用,请尝试:
gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 9AA38DCD55BE302B
apt-key add /root/.gnupg/pubring.gpg
apt-get update
Run Code Online (Sandbox Code Playgroud)
为了确保您下载的包的来源,APT 将要验证发布文件的签名。如果它无法验证它,它会抱怨你看到的消息。在这种情况下,您必须安装相应的 GPG 密钥,以便 APT 可以正确验证文件。不幸的是,您不应该盲目下载任何密钥,因为您确实希望只允许存储库所有者拥有的可信密钥。因此,您必须以确保其来源的方式下载它,而简单地下载它gpg --recv-key
并不能确保这一点。
安装新密钥是通过apt-key add <key-file>
. 大多数非官方存储库在他们的网站上为您提供密钥,并为您提供如下说明(网址当然不同):
wget -O - http://ftp-master.debian.org/keys/archive-key-5.0.asc | sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)
在官方 Debian 镜像的情况下,您应该自动安装正确的密钥,它包含在包中debian-archive-keyring
,其配置会自动激活密钥。因此,请确保已安装它,并确保它是最新的:
apt-get install debian-archive-keyring
Run Code Online (Sandbox Code Playgroud)
如果你不信任你的镜像,你也可以在用前面的方法安装正确的密钥后安装它,我实际上给出了你需要的官方密钥的URL。
有关如何处理 Debian 存档密钥的更多信息,您可以查看http://ftp-master.debian.org/keys.html。