我已经尝试在我的Debian机器上安装g++ 7很长一段时间了。我可以很容易地在我的mac上安装它(因为homebrew有一个公式)。然而,我似乎找不到一种在Linux上安装它的方法。
This individual had a thread关于安装g++ 4.9,并改变了他给我的url让我想到了to this page,这似乎是在正确的方向上……但是当我想要更新这些包时,我想这样安装它可能会导致一些潜在的问题。
我是不是漏掉了什么线人?或者有没有一个地方可以让我下载并编译运行它所需的一切?
谢谢你的帮助。
有用的数据:
我的内核是x86_64 Linux3.16.0-4-amd64。
编辑:在遵循Dietrich的建议之后,我现在遇到了一个新的错误:
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-20170316-1) but it is not going to be installed
Depends: libcc1-0 (>= 7-20170316-1) but it is not going to be installed
Depends: binutils (>= 2.28) but 2.25-5+deb8u1 is to be installed
Depends: libgcc-7-dev (= 7-20170316-1) but it is not going to be installed
Depends: libisl15 (>= 0.15) but it is not installable
Depends: libmpfr4 (>= 3.1.3) but 3.1.2-2 is to be installed
Depends: libstdc++6 (>= 5) but 4.9.2-10 is to be installed
E: Unable to correct problems, you have held broken packages.我的sources.list是这样设置的:
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free
###### Debian Update Repos
deb http://security.debian.org/ jessie/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ jessie-proposed-updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie-proposed-updates main contrib non-free
###### For ffmpeg
deb http://www.deb-multimedia.org jessie main non-free
###### For gcc-7 (Experimental)
deb http://httpredir.debian.org/debian experimental main我猜,就像你说的,这是我在Debian稳定版上遇到的问题?我需要做什么才能在保持稳定的情况下修复这个错误?
编辑2:好的,我找出了最后一个错误。我只需要为每个给我带来麻烦的依赖项添加go,并使用apt-get install -t testing安装它。感谢每一个回复的人。你们都帮了大忙。
发布于 2017-04-01 09:33:13
内核无关紧要。
正如你在GCC 7 release notes中看到的那样,GCC 7还没有发布
免责声明: GCC 7尚未发布,因此本文档仍在开发中。
您可能想了解是什么使不同的Linux发行版有所不同。特别是,什么是rolling distribution,Debian releases是如何工作的。在滚动发行版中,所有包都会不断更新到较新的版本。Debian 8.7 (杰西/稳定)不是滚动分布。包的版本被冻结,只有在必要时才会更新,以获得额外的稳定性。在Debian8.7上,最新版本的GCC是GCC 4.9。
Debian 9.0 (Stretch / testing)是一个滚动版本,至少在冻结之前是这样的。如果你把你的电脑换成伸展模式,你会看到“GCC 6.3”。
如果你需要更新的东西,你可以切换到Sid (不稳定),或者从Sid钉住包。
然而,GCC 7是only available in experimental,因为它还没有发布。如果您愿意,您可以从实验性安装单个包,有关说明,请参阅Debian Experimental。
使用方法
添加到您的/etc/apt/sources.list
https://wiki.debian.org/DebianExperimental然后
apt-get update
apt-get -t experimental install gcc-7发布于 2017-04-01 09:31:40
您可以在Stack Overflow Unix页面中找到类似的内容。要安装debian上测试中的最新g++,请执行以下操作:通过在/etc/ apt /Soures.list.d文件夹中创建包含以下行的文件(扩展名为.list ),将debian测试代码库添加到apt源代码中
deb http://ftp.us.debian.org/debian testing main contrib non-free指示debian在/etc/apt/operences.d上创建一个包含以下内容的文件,以便在某些包上使用测试源:
Package: *
Pin: release a=testing
Pin-Priority: 100您应该将该文件命名为preferences或testingpref等名称。如果您有一个preferences文件,则可以将其添加到那里。卸下.unused或any。在文件名中。
更新数据库:
sudo apt-get update安装g++:
sudo apt-get install -t testing g++这将为您提供存储库中的最新版本的g++。因此,它将接收更新,并且更容易恢复。您需要使用-t测试来获取最新版本。您可能会遇到依赖问题。它可能处于实验阶段,而不是针对您的体系结构进行测试。请参阅
对于实验包(其中有7个),添加:
deb http://httpredir.debian.org/debian experimental main添加到/etc/apt/Soures.list。与上面类似..固定应该是a=experimental而不是a=testing,最后,
sudo apt-get install -t experimental g++祝好运。
发布于 2017-04-01 09:31:07
您必须从该页面下载用于amd64的g++7 deb文件。然后,以root用户身份运行以下命令。
dpkg -i file.debhttps://stackoverflow.com/questions/43151627
复制相似问题