您的位置:首页 > 运维架构 > Linux

CentOS 6 升级安装gcc 4.8

2017-10-08 16:57 447 查看

1. 导入CERN’s GPG key

rpm --import http://linuxsoft.cern.ch/cern/slc68/x86_64/RPM-GPG-KEY-cern[/code] 

2. 添加slc6-devtoolset yum源

wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo[/code] 

3. 安装devtoolset-2

yum install devtoolset-2


4. 生效devtoolset-2

source /opt/rh/devtoolset-2/enable


可以将此命令写入
.bashrc
中,以免每次手动执行

echo 'source /opt/rh/devtoolset-2/enable' >> ~/.bashrc


差不多完成了,验证一下gcc版本:

$ gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
...
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: