我无法安装软件包,因为它要求的依赖项版本高于可用版本

我无法安装软件包,因为它要求的依赖项版本高于可用版本

很难比标题更清楚了。

我昨天从 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-coreUbuntu 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。

相关内容