我正在尝试为某些开发设置 Dockerized Wheezy,而生产服务器仍然使用这个旧的、未维护的 Debian 版本。
我遇到的主要问题是检查官方存档存储库的 GPG 签名。
从官方 docker 镜像开始,将 /etc/apt/sources.list 替换为
deb http://archive.debian.org/debian wheezy main
如果我尝试apt-get update
我会得到结果:
W: GPG error: http://archive.debian.org wheezy Release: The following signatures were invalid: KEYEXPIRED 1587841717 KEYEXPIRED 1668891673 KEYEXPIRED 1557241909
检查 GPG 密钥apt-key list | grep expired
gpg: /etc/apt//trustdb.gpg: trustdb created
pub 4096R/2B90D010 2014-11-21 [expired: 2022-11-19]
pub 4096R/C857C906 2014-11-21 [expired: 2022-11-19]
pub 4096R/518E17E1 2013-08-17 [expired: 2021-08-15]
pub 4096R/473041FA 2010-08-27 [expired: 2018-03-05]
pub 4096R/B98321F9 2010-08-07 [expired: 2017-08-05]
pub 4096R/46925553 2012-04-27 [expired: 2020-04-25]
pub 4096R/65FFB764 2012-05-08 [expired: 2019-05-07]
所以我更新了其中的大部分apt-key adv --recv-keys --keyserver keyserver.ubuntu.com $(apt-key list | grep expired | sed -E 's=[^/]+/([^ ]+).*=\1=g' | tr '\n' ' ')
,但仍然从 apt-key 列表中得到了这个结果:
pub 4096R/518E17E1 2013-08-17 [expired: 2021-08-15]
pub 4096R/B98321F9 2010-08-07 [expired: 2017-08-05]
pub 4096R/65FFB764 2012-05-08 [expired: 2019-05-07]
现在打电话apt-get update
给W: GPG error: http://archive.debian.org wheezy Release: The following signatures were invalid: KEYEXPIRED 1587841717 KEYEXPIRED 1587841717 KEYEXPIRED 1587841717 KEYEXPIRED 1587841717 KEYEXPIRED 1587841717 KEYEXPIRED 1668891673 KEYEXPIRED 1557241909
然后我尝试获取官方的 debian keyring deb 但看起来无法安装
dpkg -i /tmp/debian-archive-keyring_2023.4_all.deb
dpkg-deb: error: archive '/tmp/debian-archive-keyring_2023.4_all.deb' contains not understood data member control.tar.xz, giving up
dpkg: error processing /tmp/debian-archive-keyring_2023.4_all.deb (--install):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/tmp/debian-archive-keyring_2023.4_all.deb
apt-get --allow-unauthenticated update
不起作用,将 source.list 文件内容替换为
deb [trusted=yes] http://archive.debian.org/debian wheezy main
那么有没有办法更新这些 GPG 密钥或使其不检查它们?
如果您有可用的 docker,那么遇到该问题的最简单方法是:
>docker run -it debian:7.11 bash
root@f391e03326c6:/# echo "deb http://archive.debian.org/debian wheezy main" > /etc/apt/sources.list
root@f391e03326c6:/# apt-get update --allow-unauthenticated
自 2018 年 5 月以来,Debian 7“Wheezy”已结束生命五年。因此,过期的 PGP 密钥将不会更新或更换。您可以使用
apt-get
with--allow-unauthenticated
,但您确实应该升级到仍在维护的发行版。来自 man apt-get(8):