Centos6安装devtoolset(高版本gcc)

123 篇文章 1 订阅
48 篇文章 0 订阅

devtoolset

devtoolset,字面上可以理解为开发工具集

安装devtoolset工具

第一种方式:安装devtoolset-2-gcc-c++.x86_64

安装工具
yum -y install devtoolset-2-gcc-c++.x86_64
创建软连接
ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
清除缓存
hash -r
查看版本号
gcc --version
在这里插入图片描述

第二种方式:更新yum源

安装GCC 4.8
wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
 
yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++
 
 
以下为替换系统GCC
 
export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc export
CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp export
CXX=/opt/rh/devtoolset-2/root/usr/bin/c++
 
 
以下为替换系统GCC

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

安装GCC 4.9
wget https://copr.fedoraproject.org/coprs/rhscl/devtoolset-3/repo/epel-6/rhscl-devtoolset-3-epel-6.repo -O /etc/yum.repos.d/devtools-3.repo
yum install devtoolset-3-gcc devtoolset-3-binutils devtoolset-3-gcc-c++
 
其它参照安装gcc4.8的命令,替换目录就行

安装GCC 5.2
wget https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap/repo/epel-6/hhorak-devtoolset-4-rebuild-bootstrap-epel-6.repo -O /etc/yum.repos.d/devtools-4.repo
yum install devtoolset-4-gcc devtoolset-4-binutils devtoolset-4-gcc-c++
 
其它参照安装gcc4.8的命令,替换目录就行

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值