apt 拒绝更新某些软件包的版本

apt 拒绝更新某些软件包的版本

首先:我的 Debian 11 系统出现了一些严重问题。为了修复这个问题,我必须启动实时磁盘、挂载根分区、将 /usr/lib 从实时介质复制到根分区、chroot,然后手动重新安装所有软件包。

现在我可以再次启动系统,但由于不知道正确的版本,apt 无法安装某些软件包。例如:

# apt clean
# apt update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease                                  
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease                          
Hit:4 http://deb.debian.org/debian bullseye-backports InRelease  
Hit:5 https://packages.crunchbangplusplus.org/bullseye bullseye InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
#
# apt install seahorse
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  cracklib-runtime libavahi-glib1 libcrack2 libhandy-1-0 libpwquality-common libpwquality1
The following NEW packages will be installed:
  cracklib-runtime libavahi-glib1 libcrack2 libhandy-1-0 libpwquality-common libpwquality1 seahorse
0 upgraded, 7 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,683 kB of archives.
After this operation, 10.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://deb.debian.org/debian bullseye/main amd64 libcrack2 amd64 2.9.6-3.4 [56.0 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 cracklib-runtime amd64 2.9.6-3.4 [155 kB]
Err:3 http://deb.debian.org/debian bullseye/main amd64 libavahi-glib1 amd64 0.8-5
  404  Not Found [IP: 146.75.34.132 80]
Get:4 http://deb.debian.org/debian bullseye/main amd64 libhandy-1-0 amd64 1.0.3-2 [180 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 libpwquality-common all 1.4.4-1 [50.3 kB]
Get:6 http://deb.debian.org/debian bullseye/main amd64 libpwquality1 amd64 1.4.4-1 [13.9 kB]
Get:7 http://deb.debian.org/debian bullseye/main amd64 seahorse amd64 3.38.0.1-2 [1,184 kB]
Fetched 1,639 kB in 0s (6,082 kB/s) 
E: Failed to fetch http://deb.debian.org/debian/pool/main/a/avahi/libavahi-glib1_0.8-5_amd64.deb  404  Not Found [IP: 146.75.34.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

这是因为该文件http://deb.debian.org/debian/pool/main/a/avahi/libavahi-glib1_0.8-5_amd64.deb实际上不存在 - 正确的文件名是libavahi-glib1_0.8-5+deb11u1_amd64.deb

还请注意,这个包没有被固定或者类似的东西:

# apt-cache policy libavahi-glib1
libavahi-glib1:
  Installed: (none)
  Candidate: 0.8-5
  Version table:
     0.8-5 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages

我怎样才能让 apt 真正更新,以便安装任何软件包的最新版本?

答案1

修复了!不太清楚这里为什么会出现这种情况,但我终于找到了 apt 保存其通过 repos 提供的软件包和版本列表的位置。如果其他人遇到类似问题,请删除此缓存并使用 apt update 重新创建,一切就绪:

# rm -r /var/lib/apt/lists/*
# apt update

相关内容