![我无法安装软件包,因为它要求的依赖项版本高于可用版本](https://linux22.com/image/212219/%E6%88%91%E6%97%A0%E6%B3%95%E5%AE%89%E8%A3%85%E8%BD%AF%E4%BB%B6%E5%8C%85%EF%BC%8C%E5%9B%A0%E4%B8%BA%E5%AE%83%E8%A6%81%E6%B1%82%E7%9A%84%E4%BE%9D%E8%B5%96%E9%A1%B9%E7%89%88%E6%9C%AC%E9%AB%98%E4%BA%8E%E5%8F%AF%E7%94%A8%E7%89%88%E6%9C%AC.png)
很难比标题更清楚了。
我昨天从 debian 9 升级到 11,不知何故我的 git 包在途中被转储了。所以今天早上我很自然地尝试重新安装它。有一个问题,它要求我提供一种不存在的依赖项。
~ sudo apt install git 100 err | 10:50:02
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
git : Depends: libc6 (>= 2.34) but 2.31-13+deb11u4 is to be installed
E: Unable to correct problems, you have held broken packages.
~ sudo apt list libc6 -a 100 err | 10:51:09
Listing... Done
libc6/stable,now 2.31-13+deb11u4 amd64 [installed]
git 要求的 libc6 依赖项毫无意义,因为 debian 网站上列出的我的版本是 2.28 (https://packages.debian.org/bullseye/git)。
我最好的猜测是我的问题来自我的源文件。你觉得有什么问题吗?
deb http://[debian link]/debian bullseye main
deb http://deb[debian link]/debian bullseye-updates main
deb http://security[debian link] bullseye-security main
这是 apt 策略的结果(稍微修剪一下,因为我不能发布太多链接):
100 /var/lib/dpkg/status
release a=now
500 http://ppa.launchpad.net/git-core/ppa/ubuntu jammy/main amd64 Packages
release v=22.04,o=LP-PPA-git-core,a=jammy,n=jammy,l=Git stable releases,c=main,b=amd64
origin ppa.launchpad.net
500 http://security.[debian link] bullseye-security/main amd64 Packages
release v=11,o=Debian,a=stable-security,n=bullseye-security,l=Debian-Security,c=main,b=amd64
origin security.[debian link]
500 http://deb.[debian link]/debian bullseye-updates/main amd64 Packages
release v=11-updates,o=Debian,a=stable-updates,n=bullseye-updates,l=Debian,c=main,b=amd64
origin deb.[debian link]
500 http://deb.[debian link]/debian bullseye/main amd64 Packages
release v=11.5,o=Debian,a=stable,n=bullseye,l=Debian,c=main,b=amd64
origin deb.[debian link]
Pinned packages:```
答案1
您的系统引用了git-core
Ubuntu PPA,这是它尝试安装的位置git
。 Ubuntu PPA 不应该与 Debian 一起使用;在这种特殊情况下,您使用的是 22.04 PPA,它依赖于 Ubuntu 22.04 软件包,包括libc6
比 Debian 11 中提供的更新版本。
git
您可以从 Debian 11强制安装
sudo apt install -t bullseye git
但你确实应该删除 Ubuntu PPA。