从 Jonathon F 的 PPA 安装 gcc 7.3 时出现依赖问题

从 Jonathon F 的 PPA 安装 gcc 7.3 时出现依赖问题

我正在尝试安装最新的 gcc-7 软件包Jonathon F 的 PPA。截至 2018-02-23,看起来终于可以成功构建 amd64 了。

运行时我遇到了以下依赖问题sudo apt-get install gcc-7

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-7 : Depends: cpp-7 (= 7.3.0-5ubuntu1~16.04.york0) but it is not going to be installed
         Depends: gcc-7-base (= 7.3.0-5ubuntu1~16.04.york0) but 7.2.0-1ubuntu1~16.04 is to be installed
         Depends: libcc1-0 (>= 7.3.0-5ubuntu1~16.04.york0) but 7.2.0-1ubuntu1~16.04 is to be installed
         Depends: binutils (>= 2.28) but 2.26.1-1ubuntu1~16.04.6 is to be installed
         Depends: libgcc-7-dev (= 7.3.0-5ubuntu1~16.04.york0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

以前,我确实从 Ubuntu 的 ppa 安装了,gcc-7但那是为了7.2。我已删除该包。

运行 Synaptic,以下是可疑软件包的列表:

Synaptic 中的可升级软件包

关于如何解决这些依赖问题并安装 gcc 7.3 有什么建议吗?

答案1

看来 gcc-7 (7.3) 坏了Jonathon F 的 GCC 7.3 PPA. 我无法在干净的 Xenial 系统上安装 GCC 7.3(没有任何其他 PPA):

$ sudo add-apt-repository -y ppa:jonathonf/gcc-7.3
$ sudo apt-get update
$ sudo apt-get install gcc-7
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-7 : Depends: libcc1-0 (>= 7.3.0-5ubuntu1~16.04.york0) but 5.4.0-6ubuntu1~16.04.9 is to be installed
         Depends: binutils (>= 2.28) but 2.26.1-1ubuntu1~16.04.6 is to be installed
         Depends: libgcc-7-dev (= 7.3.0-5ubuntu1~16.04.york0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

$ grep -r ppa /etc/apt/sources.list*
/etc/apt/sources.list.d/jonathonf-ubuntu-gcc-7_3-xenial.list:deb http://ppa.launchpad.net/jonathonf/gcc-7.3/ubuntu xenial main
/etc/apt/sources.list.d/jonathonf-ubuntu-gcc-7_3-xenial.list:# deb-src http://ppa.launchpad.net/jonathonf/gcc-7.3/ubuntu xenial main

因此你应该清除这个 PPA 并使用 gcc 7.2“Ubuntu 工具链上传的 PPA(受限)”团队

sudo apt-get install ppa-purge
sudo ppa-purge ppa:jonathonf/gcc-7.3
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7
sudo apt-get install -f

然后联系 Jonathon F并告知他该问题。

更新。但我发现ppa:jonathonf/gccJonathon F 的其他 PPA。我可以从中安装 gcc 7.3。

#sudo ppa-purge ppa:ubuntu-toolchain-r/test # remove starting # if PPA added before
#sudo ppa-purge ppa:jonathonf/gcc-7.3 # remove starting # if PPA added before
sudo add-apt-repository -y ppa:jonathonf/gcc
sudo apt-get update
sudo apt-get install gcc-7 # will install 7.3.0-5ubuntu1~16.04.york0

甚至gcc-8(版本8-20180218-1ubuntu1~16.04.york0)。

答案2

使用命令从 jonathonf 添加 ppa 时

sudo add-apt-repository ppa:jonathonf/gcc-7.3

日志中显示一条消息

这是针对 ppa:jonathonf/gcc 构建的,并且需要它
更多信息:https://launchpad.net/~jonathonf/+archive/ubuntu/gcc-7.3

添加 ppa 解决依赖问题

sudo add-apt-repository ppa:jonathonf/gcc
sudo apt-get update
sudo apt-get install gcc-7                                                        

依赖问题是

以下软件包有未满足的依赖关系:gcc-7:依赖:libcc1-0(>= 7.3.0-23ubuntu2~16.04.york0)但要安装 5.4.0-6ubuntu1~16.04.11 依赖:libgcc-7-dev(= 7.3.0-23ubuntu2~16.04.york0)但它不会被安装 E:无法纠正问题,您持有损坏的软件包。

相关内容