我该如何修复这些 APT 存储库错误?我正在使用 Debian GNU/Linux 9.13 (stretch)。我希望修复此更新错误并导入 Docker GPG 密钥。
root@test:~# apt-get update
Ign:1 http://security.debian.org stretch/updates InRelease
Err:2 http://security.debian.org stretch/updates Release
404 Not Found [IP: 111.73.1113.145 90]
Get:3 https://download.docker.com/linux/debian stretch InRelease [44.8 kB]
Ign:4 http://ftp.de.debian.org/debian stretch InRelease
Err:5 http://ftp.de.debian.org/debian stretch Release
404 Not Found
Err:3 https://download.docker.com/linux/debian stretch InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7PB0A8C2F192FFDM
Reading package lists... Done
E: The repository 'http://security.debian.org stretch/updates Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ftp.de.debian.org/debian stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://download.docker.com/linux/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7PB0A8C2F192FFDM
root@test:~# apt-get install tree
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
tree
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 46.1 kB of archives.
After this operation, 106 kB of additional disk space will be used.
Err:1 http://ftp.de.debian.org/debian stretch/main amd64 tree amd64 1.7.0-5
404 Not Found
E: Failed to fetch http://ftp.de.debian.org/debian/pool/main/t/tree/tree_1.7.0-5_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
我有这个来源列表:
root@test:~# cat /etc/apt/sources.list
# deb http://ftp.de.debian.org/debian stretch main
deb http://ftp.de.debian.org/debian stretch main contrib non-free
deb-src http://ftp.de.debian.org/debian stretch main contrib non-free
deb http://security.debian.org/ stretch/updates main
deb-src http://security.debian.org/ stretch/updates main
# deb http://packages.dotdeb.org stretch all
# deb-src http://packages.dotdeb.org stretch all
由于 Docker 在我的 VM 上运行,导入 Docker GPG 密钥是否安全?
答案1
问题在于 Debian 9/stretch 已移至 archive.debian.org。
查看帖子 Debian stretch 存储库 404 未找到 寻找解决方案。
这 路易斯·埃雷拉 (Luis Herrera) 的回答 推荐这些命令:
用 archive.debian.org 替换 deb.debian.org:
sudo sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list
将 security.debian.org 替换为 archive.debian.org/debian-security/:
sudo sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list
删除包含源拉伸更新的行:
sudo sed -i '/stretch-updates/d' /etc/apt/sources.list
您也可以使用文本编辑器进行这些更改。
答案2
这对我有用(作为 root):
echo "deb [trusted=yes] http://archive.debian.org/debian stretch main non-free contrib" > /etc/apt/sources.list
echo "deb-src [trusted=yes] http://archive.debian.org/debian stretch main non-free contrib" >> /etc/apt/sources.list
echo "deb [trusted=yes] http://archive.debian.org/debian-security stretch/updates main non-free contrib" >> /etc/apt/sources.list
您可以直接复制粘贴。即使没有安装文本编辑器,它也能工作。显然,它会覆盖 /etc/apt/sources.list 中的内容,因此请确保保存好内容,以备不时之需。
现在您将能够:
# apt update
# apt install vim
答案3
对我来说,它是以这种方式起作用的。
编辑/etc/apt/sources.list
以匹配以下内容:
deb http://archive.debian.org/debian stretch main
deb http://archive.debian.org/debian-security stretch/updates main