我在完全更新的 Debian 11 (bullseye) 上遇到问题,并且我已经用尽了关于该主题的故障排除知识。我目前正在运行 3 台 PC,它们都具有由 Ansible 管理的几乎相同的配置。这三个系统中的一个,也是唯一一个在尝试apt install docker.io
通过 Ansible(以 root 身份)或手动(例如sudo apt install docker.io
)时抛出错误:
~ » sudo apt install docker.io
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
linux-image-5.10.0-15-amd64
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
cgroupfs-mount containerd libintl-perl libintl-xs-perl libmodule-find-perl libmodule-scandeps-perl libproc-processtable-perl libsort-naturally-perl libterm-readkey-perl needrestart runc tini
Suggested packages:
containernetworking-plugins docker-doc aufs-tools btrfs-progs debootstrap rinse rootlesskit xfsprogs zfs-fuse | zfsutils-linux needrestart-session | libnotify-bin iucode-tool
Recommended packages:
criu
The following NEW packages will be installed:
cgroupfs-mount containerd docker.io libintl-perl libintl-xs-perl libmodule-find-perl libmodule-scandeps-perl libproc-processtable-perl libsort-naturally-perl libterm-readkey-perl needrestart runc tini
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 40.0 MB/61.4 MB of archives.
After this operation, 270 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://deb.debian.org/debian bullseye/main amd64 runc amd64 1.0.0~rc93+ds1-5+b2
404 Not Found [IP: 2a04:4e42:a::644 80]
Err:2 http://deb.debian.org/debian bullseye/main amd64 docker.io amd64 20.10.5+dfsg1-1+deb11u1
404 Not Found [IP: 2a04:4e42:a::644 80]
Err:3 http://deb.debian.org/debian bullseye/main amd64 libintl-perl all 1.26-3
404 Not Found [IP: 2a04:4e42:a::644 80]
Err:4 http://deb.debian.org/debian bullseye/main amd64 libintl-xs-perl amd64 1.26-3
404 Not Found [IP: 2a04:4e42:a::644 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/r/runc/runc_1.0.0%7erc93%2bds1-5%2bb2_amd64.deb 404 Not Found [IP: 2a04:4e42:a::644 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/d/docker.io/docker.io_20.10.5%2bdfsg1-1%2bdeb11u1_amd64.deb 404 Not Found [IP: 2a04:4e42:a::644 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/libi/libintl-perl/libintl-perl_1.26-3_all.deb 404 Not Found [IP: 2a04:4e42:a::644 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/libi/libintl-perl/libintl-xs-perl_1.26-3_amd64.deb 404 Not Found [IP: 2a04:4e42:a::644 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
我试过的
我已经验证我已经连接到互联网,我可以在受影响的机器上连接到Firefox 中的http://deb.debian.org/debian,我可以通过 更新 Apt 的包信息sudo apt update
,我可以通过 升级包sudo apt upgrade
。
编辑: sudo apt update
返回以下输出:
~ » sudo apt update
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://security.debian.org/debian-security bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 http://deb.debian.org/debian bullseye-backports InRelease
Hit:5 https://updates.signal.org/desktop/apt xenial InRelease
Hit:6 https://packages.element.io/debian default InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
我已经等了至少一个星期,看看是否有可能通过更新解决的上游问题。没变。
我在这里搜索过类似的问题并阅读了前十名左右;我还没有看到有人提出并解决类似的问题。
我尝试通过 apt 挖掘可用版本。apt show docker.io --all-versions
在所有三台机器上运行会产生:
On working machine "M": 20.10.5+dfsg1-1+deb11u2
On working machine "Z": 20.10.5+dfsg1-1+deb11u2
On broken machine "T": 20.10.5+dfsg1-1+deb11u1
我试过手动安装机器 M 和 Z 的版本:
~ » sudo apt install docker.io=20.10.5+dfsg1-1+deb11u2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Version '20.10.5+dfsg1-1+deb11u2' for 'docker.io' was not found
我试过使用--fix-missing
. 完整输出:
~ » sudo apt install docker.io --fix-missing
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
linux-image-5.10.0-15-amd64
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
cgroupfs-mount containerd libintl-perl libintl-xs-perl libmodule-find-perl
libmodule-scandeps-perl libproc-processtable-perl libsort-naturally-perl libterm-readkey-perl
needrestart runc tini
Suggested packages:
containernetworking-plugins docker-doc aufs-tools btrfs-progs debootstrap rinse rootlesskit
xfsprogs zfs-fuse | zfsutils-linux needrestart-session | libnotify-bin iucode-tool
Recommended packages:
criu
The following NEW packages will be installed:
cgroupfs-mount containerd docker.io libintl-perl libintl-xs-perl libmodule-find-perl
libmodule-scandeps-perl libproc-processtable-perl libsort-naturally-perl libterm-readkey-perl
needrestart runc tini
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 40.0 MB/61.4 MB of archives.
After this operation, 270 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://deb.debian.org/debian bullseye/main amd64 runc amd64 1.0.0~rc93+ds1-5+b2
404 Not Found [IP: 2a04:4e42:a::644 80]
Err:2 http://deb.debian.org/debian bullseye/main amd64 docker.io amd64 20.10.5+dfsg1-1+deb11u1
404 Not Found [IP: 2a04:4e42:a::644 80]
Err:3 http://deb.debian.org/debian bullseye/main amd64 libintl-perl all 1.26-3
404 Not Found [IP: 2a04:4e42:a::644 80]
Err:4 http://deb.debian.org/debian bullseye/main amd64 libintl-xs-perl amd64 1.26-3
404 Not Found [IP: 2a04:4e42:a::644 80]
Selecting previously unselected package cgroupfs-mount.
(Reading database ... 199957 files and directories currently installed.)
Preparing to unpack .../0-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package containerd.
Preparing to unpack .../1-containerd_1.4.13~ds1-1~deb11u2_amd64.deb ...
Unpacking containerd (1.4.13~ds1-1~deb11u2) ...
Selecting previously unselected package libmodule-find-perl.
Preparing to unpack .../2-libmodule-find-perl_0.15-1_all.deb ...
Unpacking libmodule-find-perl (0.15-1) ...
Selecting previously unselected package libmodule-scandeps-perl.
Preparing to unpack .../3-libmodule-scandeps-perl_1.30-1_all.deb ...
Unpacking libmodule-scandeps-perl (1.30-1) ...
Selecting previously unselected package libproc-processtable-perl.
Preparing to unpack .../4-libproc-processtable-perl_0.59-2+b1_amd64.deb ...
Unpacking libproc-processtable-perl (0.59-2+b1) ...
Selecting previously unselected package libsort-naturally-perl.
Preparing to unpack .../5-libsort-naturally-perl_1.03-2_all.deb ...
Unpacking libsort-naturally-perl (1.03-2) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../6-libterm-readkey-perl_2.38-1+b2_amd64.deb ...
Unpacking libterm-readkey-perl (2.38-1+b2) ...
Selecting previously unselected package tini.
Preparing to unpack .../7-tini_0.19.0-1_amd64.deb ...
Unpacking tini (0.19.0-1) ...
Setting up libmodule-find-perl (0.15-1) ...
Setting up tini (0.19.0-1) ...
Setting up libproc-processtable-perl (0.59-2+b1) ...
Setting up cgroupfs-mount (1.4) ...
Setting up libterm-readkey-perl (2.38-1+b2) ...
dpkg: dependency problems prevent configuration of containerd:
containerd depends on runc (>= 0.1.0~); however:
Package runc is not installed.
dpkg: error processing package containerd (--configure):
dependency problems - leaving unconfigured
Setting up libsort-naturally-perl (1.03-2) ...
Setting up libmodule-scandeps-perl (1.30-1) ...
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
containerd
E: Failed to fetch http://deb.debian.org/debian/pool/main/r/runc/runc_1.0.0%7erc93%2bds1-5%2bb2_amd64.deb 404 Not Found [IP: 2a04:4e42:a::644 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/d/docker.io/docker.io_20.10.5%2bdfsg1-1%2bdeb11u1_amd64.deb 404 Not Found [IP: 2a04:4e42:a::644 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/libi/libintl-perl/libintl-perl_1.26-3_all.deb 404 Not Found [IP: 2a04:4e42:a::644 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/libi/libintl-perl/libintl-xs-perl_1.26-3_amd64.deb 404 Not Found [IP: 2a04:4e42:a::644 80]
E: Sub-process /usr/bin/dpkg returned an error code (1)
(然后系统处于损坏状态, Apt 建议 I run apt --fix-broken install
。由于同样的问题,失败了。要恢复系统,我必须运行apt remove containerd
并apt autoremove
采取良好措施。)
我在 Firefox 中打开https://deb.debian.org/debian/pool/main/d/docker.io/并观察到版本 20.10.5+dfsg1-1+deb11u1 没有 .deb 文件。不过,我不知道为什么这个特定的系统不会安装 +deb11u2 。
基于这个答案,我已经运行apt-cache policy
:
# Working machine M
~ » apt-cache policy docker.io
docker.io:
Installed: 20.10.5+dfsg1-1+deb11u2
Candidate: 20.10.5+dfsg1-1+deb11u2
Version table:
*** 20.10.5+dfsg1-1+deb11u2 500
500 http://deb.debian.org/debian bullseye/main amd64 Packages
100 /var/lib/dpkg/status
# Working machine Z
~ » apt-cache policy docker.io
docker.io:
Installed: 20.10.5+dfsg1-1+deb11u2
Candidate: 20.10.5+dfsg1-1+deb11u2
Version table:
*** 20.10.5+dfsg1-1+deb11u2 500
500 http://deb.debian.org/debian bullseye/main amd64 Packages
100 /var/lib/dpkg/status
# Broken machine T
~ » apt-cache policy docker.io
docker.io:
Installed: (none)
Candidate: 20.10.5+dfsg1-1+deb11u1
Version table:
20.10.5+dfsg1-1+deb11u1 500
500 http://deb.debian.org/debian bullseye/main amd64 Packages
这似乎没有回答这个问题,所以我通过以下方式查看了可用版本apt-cache madison
:
# Working machine M
~ » apt-cache madison docker.io
docker.io | 20.10.5+dfsg1-1+deb11u2 | http://deb.debian.org/debian bullseye/main amd64 Packages
docker.io | 20.10.5+dfsg1-1 | http://deb.debian.org/debian bullseye/main Sources
docker.io | 20.10.5+dfsg1-1+deb11u1 | http://deb.debian.org/debian bullseye/main Sources
docker.io | 20.10.5+dfsg1-1+deb11u2 | http://deb.debian.org/debian bullseye/main Sources
docker.io | 20.10.5+dfsg1-1+deb11u2 | http://deb.debian.org/debian bullseye-backports/main Sources
# Working machine Z
~ » apt-cache madison docker.io
docker.io | 20.10.5+dfsg1-1+deb11u2 | http://deb.debian.org/debian bullseye/main amd64 Packages
docker.io | 20.10.5+dfsg1-1 | http://deb.debian.org/debian bullseye/main Sources
docker.io | 20.10.5+dfsg1-1+deb11u1 | http://deb.debian.org/debian bullseye/main Sources
docker.io | 20.10.5+dfsg1-1+deb11u2 | http://deb.debian.org/debian bullseye/main Sources
docker.io | 20.10.5+dfsg1-1+deb11u2 | http://deb.debian.org/debian bullseye-backports/main Sources
# Broken machine T
~ » apt-cache madison docker.io
docker.io | 20.10.5+dfsg1-1+deb11u1 | http://deb.debian.org/debian bullseye/main amd64 Packages
docker.io | 20.10.5+dfsg1-1 | http://deb.debian.org/debian bullseye/main Sources
docker.io | 20.10.5+dfsg1-1+deb11u1 | http://deb.debian.org/debian bullseye/main Sources
docker.io | 20.10.5+dfsg1-1+deb11u2 | http://deb.debian.org/debian bullseye-backports/main Sources
我在 madison 输出中发现的差异是(a)机器 T 在 Packages 行上有 +deb11u1 而不是 +deb11u2 并且(b)机器 T 缺少 +deb11u2 Sources 行。我仍然不明白为什么 Apt 正在寻找丢失的版本,或者不会提供同一存储库中可用的任何其他版本。
我apt-cache showpkg docker.io
在机器 T 和 Z 上运行,并仔细比较了输出diff
。破机T显示:
~ » apt-cache showpkg docker.io
Package: docker.io
Versions:
20.10.5+dfsg1-1+deb11u1 (/var/lib/apt/lists/deb.debian.org_debian_dists_bullseye_main_binary-amd64_Packages)
Description Language:
File: /var/lib/apt/lists/deb.debian.org_debian_dists_bullseye_main_binary-amd64_Packages
MD5: 05dc9eba68f3bf418e6a0cf29d555878
Description Language: en
File: /var/lib/apt/lists/deb.debian.org_debian_dists_bullseye_main_i18n_Translation-en
MD5: 05dc9eba68f3bf418e6a0cf29d555878
Reverse Depends:
runc,docker.io 1.13.1~ds1-2
docker-compose,docker.io 1.9.0
lava-dispatcher,docker.io
lava,docker.io
containerd,docker.io 1.12
whalebuilder,docker.io
toil,docker.io
subuser,docker.io
docker-compose,docker.io 1.9.0
ruby-docker-api,docker.io
python3-testinfra,docker.io
piuparts,docker.io
packer,docker.io
libnss-docker,docker.io
lava-dispatcher,docker.io
lava,docker.io
due,docker.io
containerd,docker.io 1.12
docker-clean,docker.io
docker-clean,docker.io
debocker,docker.io
datalad-container,docker.io
cwltool,docker.io
amazon-ecr-credential-helper,docker.io
charliecloud-builders,docker.io
amazon-ecr-credential-helper,docker.io
Dependencies:
20.10.5+dfsg1-1+deb11u1 - init-system-helpers (2 1.54~) libc6 (2 2.4) libdevmapper1.02.1 (2 2:1.02.97) libsystemd0 (0 (null)) adduser (0 (null)) containerd (2 1.4~) iptables (0 (null)) lsb-base (0 (null)) runc (2 1.0.0~rc8~) tini (0 (null)) docker-ce (0 (null)) docker-ce-cli (0 (null)) docker-ce-rootless-extras (0 (null)) apparmor (0 (null)) ca-certificates (0 (null)) cgroupfs-mount (0 (null)) git (0 (null)) needrestart (2 3.1~) xz-utils (0 (null)) docker-doc (0 (null)) aufs-tools (0 (null)) btrfs-progs (0 (null)) debootstrap (0 (null)) e2fsprogs (0 (null)) rinse (0 (null)) rootlesskit (0 (null)) xfsprogs (0 (null)) zfs-fuse (16 (null)) zfsutils-linux (0 (null))
Provides:
20.10.5+dfsg1-1+deb11u1 -
Reverse Provides:
为简洁起见,我不会在此处发布机器 Z 的输出,但唯一的区别是它在所有 3 个位置都显示 +deb11u2 而不是 +deb11u1。我在这个输出中也没有看到任何解释,AFAICT。
这是我的故障排除知识的限制。发生了什么事,我该如何解决?非常感谢!
意味着由于某种原因,
apt
它不会更新存储库信息,因为它认为它是最新的。要强制它下载存储库信息,请删除本地副本:删除所有内容
/var/lib/apt/lists
并sudo apt update
再次运行。