升级到4.8【这个应该是目前最新的啦,不过网上查的话已经到5.2啦,感觉落后一点比较稳,当然还有就是这个版本是新的里面使用最多的】

wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo

cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools-2/devtools-2.repo

然后

yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++

这个将安装的文件放在了

/opt/rh/devtoolset-2

如果想要编辑器去处理的话,这样操作

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替换本地的,当然不是真的去替换,只要把他放在我们的/usrlocal/bin下面就好了,不必去管系统自带的【/usr/bin】。

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

这个两个部分的路径变了【请看这里】:http://people.centos.org/tru/devtools-2/readme

参考资料:http://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos

centos升级支持到C++11, gcc4.8.2的更多相关文章

  1. centos6.5/6.3升级安装ImageMagick7.0.1-1

    线上论坛和应用程序的验证码功能都是使用的ImageMagick,但是版本比较老(centos yum安装的ImageMagick6.5.9).接到最新漏洞预报,紧急升级! ImageMagick图象处 ...

  2. c++11 gcc4.8.x安装

    c++11 gcc4.8.x安装 2014年12月11日默北   要安装PHP-CPP,需要c++11,否则就会报错,错误信息如下所示: g++ -Wall -c -g -std=c++11 -fpi ...

  3. CentOS升级Svn到最新版

    CentOS升级Svn到最新版(金庆的专栏)CentOS/RHEL yum 安装的 subversion 是 1.6.11 版本,连VisulaSVN服务器时会有"Key usage vio ...

  4. Centos——升级Python2.7及安装pip

    CentOS升级Python2.7及安装pip 1) 升级Python2.7 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ...

  5. Centos 升级MySQL版本或者Yum安装Mysql5.6

    Centos 升级MySQL版本或者Yum安装Mysql5.6 1.从MySQL Yum仓库下载最新的rpm文件:http://dev.mysql.com/downloads/repo/yum/Cen ...

  6. CentOS 7.1静默安装11.2.0.3 64位单机数据库软件

    第1章 CentOS 7.1静默安装11.2.0.3 64位单机数据库软件 1.1  安装前的准备工作 1.1.1      软件准备 1.1.2      检查硬件 注意这里的内存应该满足要求,不然 ...

  7. ubuntn 内核升级到LINUX v4.11.8:

    升级到LINUX v4.11.8: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11.8/linux-headers-4.11.8-041108_ ...

  8. CentOS升级kernel

    CentOS升级kernel 升级命令: yum update kernel yum update kernel-devel yum update kernel-firmware yum update ...

  9. Centos升级gcc4.4.7升级gcc4.8手记

    本博客来自:http://www.mudbest.com/centos%E5%8D%87%E7%BA%A7gcc4-4-7%E5%8D%87%E7%BA%A7gcc4-8%E6%89%8B%E8%AE ...

随机推荐

  1. The 2015 China Collegiate Programming Contest E. Ba Gua Zhen hdu 5544

    Ba Gua Zhen Time Limit: 6000/4000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total ...

  2. C++11 feature: move constructor

    There are heaps of good articles out there about C++ features including this move constructor. Howev ...

  3. 让 Web 站点崩溃最常见的七大原因

    磁盘已满 导致系统无法正常运行的最可能的原因是磁盘已满.一个好的网络管理员会密切关注磁盘的使用情况,隔一定的时间,就需要将磁盘上的一些负载转存到备份存储介质中(例如磁带).   日志文件会很快用光所有 ...

  4. 【BZOJ】2693: jzptab

    http://www.lydsy.com/JudgeOnline/problem.php?id=2693 题意:求$\sum_{i=1}^{n} \sum_{j=1}^{m} lcm(i, j)$, ...

  5. Vijos 1092 全排列

    题目链接 来个水题..难得的1Y. #include <cstdio> #include <cstring> #include <iostream> using n ...

  6. asp.net mvc本地程序集和GAC的程序集冲突解决方法

    一个从asp.net mvc 3升级到asp.net mvc 4的项目发生了如下错误: [A]System.Web.WebPages.Razor.Configuration.HostSection c ...

  7. 纪念逝去的岁月——C/C++字符串反转

    几年前,我还不会写这个 输入:hello world 输出:dlrow olleh 代码 #include <stdio.h> #include <string.h> void ...

  8. MongoDB介绍及安装

    一.介绍: 1.NoSql(非关系型的数据库)成了一个极其热门的新领域,非关系数据库产品的发展非常迅速.MongoDB是NoSql的其中一种较为热门的非关系型数据库.查阅很多资料.其他博客和网站,借着 ...

  9. kinderEditor + Struts2整合

    环境: kinderEditor4.1.5 Struts2.3.5 Spring3.0.5 Hibernate3.6 代码: FileManageAction package com.hcsoft.p ...

  10. [LintCode] Longest Increasing Continuous Subsequence 最长连续递增子序列

    Give an integer array,find the longest increasing continuous subsequence in this array. An increasin ...