CentOS 6 升级安装gcc 4.8

1. 导入CERN’s GPG key

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

2. 添加slc6-devtoolset yum源

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

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)
...

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native