以某种方式,im最终出现在包依赖循环中。当我试图升级我的软件包时,会出现以下情况:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libapt-pkg6.0 : Depends: libgcrypt20 (>= 1.10.0) but 1.9.4-3ubuntu3 is installed
Depends: libzstd1 (>= 1.5.2) but 1.4.8+dfsg-3build1 is installed
Recommends: apt (>= 2.5.3) but 2.4.8 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).所以我尝试了sudo apt --fix-broken install
sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
libapt-pkg6.0 : Depends: libgcrypt20 (>= 1.10.0) but 1.9.4-3ubuntu3 is installed
Depends: libzstd1 (>= 1.5.2) but 1.4.8+dfsg-3build1 is installed
Recommends: apt (>= 2.5.3) but 2.4.8 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies然后我尝试删除/清除包sudo apt purge libapt-pkg6.0:amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
apt : Depends: libapt-pkg6.0 (>= 2.4.8) but it is not going to be installed
apt-utils : Depends: libapt-pkg6.0 (>= 2.4.8) but it is not going to be installed
packagekit : Depends: libapt-pkg6.0 (>= 1.9.2) but it is not going to be installed
python3-apt : Depends: libapt-pkg6.0 (>= 1.9.11~) but it is not going to be installed
ubuntu-advantage-tools : Depends: libapt-pkg6.0 (>= 0.8.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).apt policy libapt-pkg6.0输出
libapt-pkg6.0:
Installed: 2.5.3
Candidate: 2.5.3
Version table:
*** 2.5.3 100
100 /var/lib/dpkg/status
2.4.8 500
500 http://ch.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
2.4.5 500
500 http://ch.archive.ubuntu.com/ubuntu jammy/main amd64 Packages我也尝试过其他的方法,但我似乎还是坚持了这个立场。任何建议都会有帮助。
发布于 2022-11-03 20:10:31
好吧,我想我找到了一个解决办法:
我第一次用:
sudo dpkg -r --force-depends libapt-pkg6.0:amd64若要除去依赖项,则删除包。
然后我下载了正确的版本:
wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg6.0_2.4.5_amd64.deb然后安装:
sudo dpkg -i libapt-pkg6.0_2.4.5_amd64.deb重新启动系统,然后更新和升级再次工作。
发布于 2022-11-03 17:14:23
看起来您在某个时候将22.10 (动能)软件包安装到了22.04 (jammy)系统上。
22.10 = 2.5.3版本中的libapt-pkg6.0。
教训:除非你是专家,否则不要混合Ubuntu不同版本的包。
你有三个选择:
do-release-upgrade,因为您的包有未满足的依赖项。这是否可能取决于你造成了多大的损害,你是如何造成的,以及你是否有能力修复它。它需要手动修复源,然后使用dist-upgrade。这不是一个支持的升级路径,所以如果您遇到问题,我们的建议是重新安装。https://askubuntu.com/questions/1438909
复制相似问题