尝试在 Debian 11 / Q4OS Centaurus 上安装软件包“build-essential”时如何修复错误?

尝试在 Debian 11 / Q4OS Centaurus 上安装软件包“build-essential”时如何修复错误?
sudo apt install build-essential

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:
 libr0 : Depends: libbinutils (< 2.31.2) but 2.35.2-2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

apt policy libr0节目

libr0:
  Installed: 4:14.0.6-0debian10.0.0+0~a
  Candidate: 4:14.0.6-0debian10.0.0+0~a
  Version table:
 *** 4:14.0.6-0debian10.0.0+0~a 500
        500 http://q4os.org/qtderepo buster/main amd64 Packages
        100 /var/lib/dpkg/status

apt policy libbinutils节目

libbinutils:
  Installed: 2.31.1-16
  Candidate: 2.35.2-2
  Version table:
     2.35.2-2 500
        500 http://ftp.de.debian.org/debian bullseye/main amd64 Packages
 *** 2.31.1-16 500
        500 http://ftp.debian.org/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status

并尝试升级libbinutils结果

WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  q4os-desktop tdelibs14-trinity (due to q4os-desktop)
  tdebase-trinity-bin (due to q4os-desktop)
  tdesudo-trinity (due to q4os-desktop)
  tde-style-q4oststyle02-trinity (due to q4os-desktop)
  twin-trinity (due to q4os-desktop) network-manager-tde (due to q4os-desktop

答案1

看来你的系统运行的是 Q4OS Centaurus,而不是 Debian 11。Q4OS 是基于在 Debian 上但不是 Debian;最好坚持使用您的 Q4OS 版本所基于的 Debian 版本(在 Q4OS Centaurus 的情况下为 Debian 10)。

Q4OS Gemini 基于 Debian 11,因此如果您升级到该版本,您将能够使用 Debian 11 中的软件包。

答案2

按如下方式解决E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages错误消息。

  1. /var/log/apt/term.log在文本编辑器中打开日志文件。

  2. 找到所有“损坏”的软件包并使用 删除它们。您已经知道您的操作系统上安装了基于 Debian 11 的 Debian 10 软件包,但这些软件包与 Debian 11 不兼容。这将帮助您找到一些损坏的软件包,但也可能还有其他软件包。在未安装新的桌面环境来替换并登录到新的桌面环境之前,请勿卸载现有的桌面环境。sudo apt remove name-of-broken-package

相关内容