现在的位置: 首页 > 综合 > 正文

Centos6.0 通过devtoolset-2工具安装gcc 4.8

2018年05月18日 ⁄ 综合 ⁄ 共 755字 ⁄ 字号 评论关闭

具体步骤:

1、Save repository information as /etc/ yum .repos.d/slc6- devtoolset.repo on your system,then install it using yum

wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
yum install devtoolset-2

2、在安装过程中出现了错误:找不到相关的 GPG key,只要根据提示安装相应的
GPG key 即可

这一步最关键,14年2月份给出的以下密钥已经不可用,当前可用的如下:

rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern

这一步就是我写这篇博客的主要原因,可能你看到博文时这个GPG key已不可用,这时可以参考:

http://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos

3、重新安装即可

yum install devtoolset-2

4、export

ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
gcc --version

备注:

需要参考的几个网址:

Developer Toolset

Scientific Linux

Install gcc 4.7 on Centos

RedHat Developer Toolset

抱歉!评论已关闭.