我使用的是 debian 8 Jessie,它的存储库中只有 gcc-4.9。我尝试了两种方式安装 gcc-4.7 都没有成功。
先试试
我尝试通过下载文件 gcc-4.7.0.tar.gz 手动安装 gcc 但是当我安装依赖库时(apt-get install Libmpc-dev libmpfr-dev libgmp-dev gcc-multilib) Debian 安装,无需询问 gcc-4.9 和与 gcc-4.9 兼容的库。 我尝试运行 make 进行手动安装,但出现错误,无法手动安装。
第二次尝试
我尝试在文件/etc/apt/sourc.list 中使用 gcc-4.7 添加 PPA 存储库 Add-apt-repository ppa: ubuntu-toolchain-r/test 在此链接中教导:https://askubuntu.com/questions/193513/problem-adding-a-ppa-to-install-gcc-4-7
当尝试 apt-get install gcc-4.7 时,系统会提示您安装几个依赖项......当请求安装依赖项时,如下所示。
Root @ vmhp110deb8: / home / user1 # apt-get install gcc-4.7 gcc-4.7-base
Reading package lists ... Done
Building dependency tree
Reading state information ... Done
Note, by selecting 'gcc-4.7-base' for regex 'gcc-4.7'
Package gcc-4.7-base is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
Is available from another source
E: Package 'gcc-4.7-base' has no installation candidate
Root @ vmhp110deb8: / home / user1 # add-apt-repository ppa: ubuntu-toolchain-r / test
我试图找到一个有 gcc-4.7-base 的存储库,但是它要求安装其他依赖项,并通知它没有找到 库已过时等
尚未测试的尝试
我的另一个想法是下载 Debian 7 Wheezy DVD(我认为它有 gcc-4.7 和所有依赖项)并添加为存储库,以便 debian 在 DVD 上找到 gcc.4.7 的所有依赖项。但是这个想法我还没有测试过。
谁能帮助我如何在 debian 8 上安装 gcc 4.7?
最佳答案
如您所见 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765379
gcc-4.7 不包含在 Debian Jessie 中
也许你可以试试这个
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.7
编辑:您已经尝试过了。我没注意到。
试试这个手册: http://charette.no-ip.com:81/programming/2011-12-24_GCCv47/
希望对你有帮助:)
关于linux - gcc-4.7 与 Debian 8 杰西,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41412535/