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

本文提供了一种在CentOS上安装GCC 4.7的具体步骤,包括保存软件仓库信息、解决GPG key缺失问题、安装Developer Toolset等关键环节。

详细步骤:

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值