我在更新源列表时遇到以下错误
$ sudo apt-get update
Reading package lists... Done
W: GPG error: http://archive.debian.org lenny/updates Release: The following signatures were invalid: KEYEXPIRED 1356982504
W: You may want to run apt-get update to correct these problems
如何解决这个问题?
要查找任何过期的存储库密钥及其 ID,请使用 apt-key,如下所示:
apt-key list | grep expired
您将得到类似于以下内容的结果:
pub 4096R/BE1DB1F1 2011-03-29 [expired: 2014-03-28]
密钥 ID 是 / 之后的位,即本例中的 BE1DB1F1。
要更新密钥,请运行
sudo apt-key adv --recv-keys --keyserver keys.gnupg.net BE1DB1F1
我遇到了同样的问题,我只是更改了系统日期
date --set 2008-01-01
然后尝试更新
apt-get update
最后,这些答案都解决了我的问题。
我所做的是重新检查最新的可用资源。就我而言
###### Debian Main Repos
deb http://ftp.au.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.au.debian.org/debian/ wheezy main contrib non-free
###### Debian Update Repos
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb http://ftp.au.debian.org/debian/ wheezy-proposed-updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://ftp.au.debian.org/debian/ wheezy-proposed-updates main contrib non-free
我使用这个网站生成它们。 https://debgen.simplylinux.ch/ Debian 源代码生成器。
然后我更新存储库中的密钥。
apt-get install debian-keyring debian-archive-keyring
apt-key update
然后再次尝试更新
apt-get update
这可能会解决问题。
Fetched 67.5 kB in 2min 0s (560 B/s)
Reading package lists... Done
如果某些按键仍然存在问题,请按照每个按键执行后续步骤。
您需要从另一台服务器手动添加密钥。 在这种情况下,丢失的密钥是 55BE302B
所以你必须做:
gpg --keyserver pgpkeys.mit.edu --recv-key 55BE302B
gpg -a --export 55BE302B | sudo apt-key add -
它将导入密钥,然后将它们添加到源中。
root@XXX:~# gpg --keyserver pgpkeys.mit.edu --recv-key 55BE302B
gpg: requesting key 55BE302B from hkp server pgpkeys.mit.edu
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 55BE302B: public key "Debian Archive Automatic Signing Key (5.0/lenny) <[email protected]>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
root@XXX:~# gpg -a --export 55BE302B | sudo apt-key add -
OK
我希望这可以帮助任何面临同样问题的人。
解决此问题的一种方法是刷新 GPG 密钥,以便本地密钥环可以成功验证签名
RUN apt-get update && apt-get install -y debian-archive-keyring && apt-get clean