cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo
yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++

This will install it most likely into /opt/centos/devtoolset-1.1/root/usr/bin/

Then you can tell your compile process to use the gcc 4.7 instead of 4.4 with the CC variable

export CC=/opt/centos/devtoolset-1.1/root/usr/bin/gcc
export CPP=/opt/centos/devtoolset-1.1/root/usr/bin/cpp
export CXX=/opt/centos/devtoolset-1.1/root/usr/bin/c++
For g++ 4.8.2, change 1.1 to 2 everywhere, and change --enablerepo=testing-1.1-devtools-6 to--enablerepo=testing-devtools-2-centos-6

There is new version of devtoolset 2.0. Nice people from Cern working on Scientific Linux createdan open version:

If you use CentOS (not Scientific Linux), then you will have to import their GPG key from here using:

rpm --import http://www.scientificlinux.org/documentation/gpg/RPM-GPG-KEY-cern

Enjoy!

EL6 gcc-4.8 http://www.hop5.in/yum/el6/repoview/gcc.html

or this

http://puias.princeton.edu/data/puias/DevToolset/6/x86_64/ /etc/yum.repos.d/DevToolset.repo

[DevToolset-2]
name=RedHat DevToolset v2 $releasever - $basearch
baseurl=http://people.centos.org/tru/devtools-2/$basearch/
enabled=1
gpgcheck=0

Testing run

# yum install devtoolset-2-gcc-4.8.2 devtoolset-2-gcc-c++-4.8.2
# /opt/rh/devtoolset-2/root/usr/bin/gcc --version

export 做好软链接

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

centos6 yum 安装 install c++4.8 gcc4.8的更多相关文章

  1. Linux -- Centos6 yum安装相关问题与处理

    Centos6 yum安装相关问题与处理 由于要使用yum下载文件,突然yum下载不了想要的文件,想更换yum源,结果得重新安装yum 来自本人GitHub地址https://github.com/m ...

  2. centos6 yum 安装memcached

    centos6 yum 安装memcached - 像块石头 - 博客园http://www.cnblogs.com/rockee/archive/2012/08/01/2619160.html yu ...

  3. Centos6 yum安装openldap+phpldapadmin+TLS+双主配置

    原文地址:http://54im.com/openldap/centos-6-yum-install-openldap-phpldapadmin-tls-%E5%8F%8C%E4%B8%BB%E9%8 ...

  4. Centos6 yum安装nginx

    1.Centos6系统库中默认是没有nginx的rpn包的,所以我们需要先更新下rpm依赖库 (1):使用yum安装nginx,安装nginx库 rpm -Uvh http://nginx.org/p ...

  5. centos6 yum安装jdk1.8+

    一.环境Linux操作系统: centos6.9 安装jdk版本: jdk1.8+ 二.安装步骤1. 检查系统是否自带有jdk[root@VM_0_11_centos ~]# rpm -qa |gre ...

  6. CentOS-6 yum安装nginx php53 mysql55 搭建LNMP环境

    1.导入外部软件库 01.rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noa ...

  7. CentOS6 YUM安装MariaDB10.3.10

    1.先新增加一个MariaDB.repo vi /etc/yum.repos.d/MariaDB.repo [mariadb] name = MariaDB baseurl = http://mirr ...

  8. linux centos6 yum 安装lamp

    centos 6.5 1.yum安装和源代码编译在使用的时候没啥区别,但是安装的过程就大相径庭了,yum只需要3个命令就可以完成,源代码需要13个包,还得加压编译,步骤很麻烦,而且当做有时候会出错,源 ...

  9. centos6 yum 安装nginx 不成功解决办法

    转自  http://wlheihei.com/view/64 [root@51ou.com yum.repos.d]# yum install nginxLoaded plugins: fastes ...

随机推荐

  1. windows下安装TensorFlow(CPU版)

    建议先到anaconda官网下载最新windows版的anaconda3.6,然后按步骤进行安装.(这里我就不贴图了,自己下吧) 1.准备安装包 http://www.lfd.uci.edu/~goh ...

  2. jdk的环境配置

    今天在网上找了关于jdk配置的教程,发现比较繁琐,因此更新下jdk的简单配置教程 注意:jdk的安装必须正确,绝对不允许将jdk和jdr安装在同一层目录!!(建议在java目录下新建jdk和jdr目录 ...

  3. 爬虫(GET)——add_header()和get_header()

    import urllib.request import random url = "http://www.baidu.com/" # 可以是User-Agent列表,也可以是代理 ...

  4. Ajax传统操作

    JavaScript:                                                                                         ...

  5. fiddler中安装证书进行https协议的抓取

    Fiddler目前默认安装对http协议进行抓取但是对手机以及其他一些是https协议的通讯抓取需要配置. 电脑Fiddler设置: 1.首页我们要在fiddler中找到菜单栏的Tools > ...

  6. spark on yarn,cluster模式时,执行spark-submit命令后命令行日志和YARN AM日志

    [root@linux-node1 bin]# ./spark-submit \> --class com.kou.List2Hive \> --master yarn \> --d ...

  7. c++ 封装线程库 2

    1.2线程回收: 首先得知道线程的两个状态: Joinable Detached 简单理解,如果一个线程是joinable的状态,那么这样的线程,就必须使用pthread_join来回收,否则程序结束 ...

  8. Java-IO中的节点流和处理流

    理解好Java-IO中的节点流和处理流是理解Java输入.输出的关键基础,因此,了解节点流和处理流相关的知识点尤为重要. 1.定义 (1)节点流:可以从或向一个特定的地方(节点)读写数据.如FileR ...

  9. python 矢量化的字符串

  10. regular expression, grep (python, linux)

    https://docs.python.org/2/library/re.html re.match(pattern, string, flags=0)  尝试从字符串的起始位置匹配一个模式 re.s ...