build-essential
在新安装的Ubuntu 18.10上安装失败,并显示以下错误:
$ sudo apt install build-essential
Reading package lists... Done
Building dependency tree
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:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: gcc (>= 4:7.3) but it is not going to be installed
Depends: g++ (>= 4:7.3) but it is not going to be installed
Depends: dpkg-dev (>= 1.17.11) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
通过deb文件安装也失败。
我认为此软件包未正确移植到18.10,因为它要求过时的依赖项(在18.04 LTS中可用的依赖项版本)。最安全的安装方法是什么?
请注意,我已经使用不安全的方法(例如,通过aptitude降级软件包)在其他机器上安装了该软件包,但是此方法破坏了太多其他软件包。
更新#1:
libc6-dev安装失败。
$ sudo apt install libc6-dev
Reading package lists... Done
Building dependency tree
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:
libc6-dev : Depends: libc6 (= 2.27-3ubuntu1) but 2.28-0ubuntu1 is to be installed
Depends: libc-dev-bin (= 2.27-3ubuntu1)
E: Unable to correct problems, you have held broken packages.
我不知道apt为什么要寻找libc6
and的旧版本libc-dev-bin
。
同样,apt显示gcc也取决于的早期版本cpp
。
$ sudo apt install gcc
Reading package lists... Done
Building dependency tree
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:
gcc : Depends: cpp (= 4:8.1.0-2ubuntu1) but 4:8.2.0-1ubuntu1 is to be installed
Depends: gcc-8 (>= 8.1.0-4~) but it is not going to be installed
Recommends: libc6-dev but it is not going to be installed or
libc-dev
E: Unable to correct problems, you have held broken packages.
更新#2: apt-cache策略输出
$ apt-cache policy gcc cpp
gcc:
Installed: (none)
Candidate: 4:8.1.0-2ubuntu1
Version table:
4:8.1.0-2ubuntu1 500
500 http://pk.archive.ubuntu.com/ubuntu cosmic/main amd64 Packages
cpp:
Installed: 4:8.2.0-1ubuntu1
Candidate: 4:8.2.0-1ubuntu1
Version table:
*** 4:8.2.0-1ubuntu1 100
100 /var/lib/dpkg/status
4:8.1.0-2ubuntu1 500
500 http://pk.archive.ubuntu.com/ubuntu cosmic/main amd64 Packages
我怀疑(现在证明)您使用的镜子严重过时,例如。如果您检查了https://launchpad.net/ubuntu/+archivemirrors,我相信您选择的镜像将列出未知的最新更新(计数器在很久以前就溢出了),因此您的软件包会出现问题。
我怀疑这是因为您的结果与https://packages.ubuntu.com/上的预期软件包不匹配
解决方法是切换到维护的镜像(从上述列表)或主归档。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句