第一阶段:升级到4.7

[root@01314.CN ~]# cd /etc/yum.repos.d
[root@01314.CN yum.repos.d]# wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo
[root@01314.CN yum.repos.d]# yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++

安装文件放置位置在:/opt/centos/devtoolset-1.1
具体程序文件位置在:/opt/centos/devtoolset-1.1/root/usr/bin/*

使用最新的gcc环境,所以要替换本地的,使用软连接来完成(也可以设置环境变量,看自己喜好)

[root@01314.CN ~]# mv /usr/bin/gcc /usr/bin/gcc-4.4.7
[root@01314.CN ~]# mv /usr/bin/g++ /usr/bin/g++-4.4.7
[root@01314.CN ~]# mv /usr/bin/c++ /usr/bin/c++-4.4.7
[root@01314.CN ~]# ln -s /opt/centos/devtoolset-1.1/root/usr/bin/gcc /usr/bin/gcc
[root@01314.CN ~]# ln -s /opt/centos/devtoolset-1.1/root/usr/bin/c++ /usr/bin/c++
[root@01314.CN ~]# ln -s /opt/centos/devtoolset-1.1/root/usr/bin/g++ /usr/bin/g++
[root@01314.CN ~]# gcc --version

第二阶段:升级到4.8

[root@01314.CN ~]# cd /etc/yum.repos.d
[root@01314.CN yum.repos.d]# wget http://people.centos.org/tru/devtools-2/devtools-2.repo
[root@01314.CN yum.repos.d]# yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++

安装文件放置位置在:/opt/rh/devtoolset-2
具体程序文件位置在:/opt/rh/devtoolset-2/root/usr/bin/*

使用最新的gcc环境,所以要替换本地的,使用软连接来完成(也可以设置环境变量,看自己喜好)

[root@01314.CN ~]# mv /usr/bin/gcc /usr/bin/gcc-4.4.7
[root@01314.CN ~]# mv /usr/bin/g++ /usr/bin/g++-4.4.7
[root@01314.CN ~]# mv /usr/bin/c++ /usr/bin/c++-4.4.7
[root@01314.CN ~]# ln -s /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc
[root@01314.CN ~]# ln -s /opt/rh/devtoolset-2/root/usr/bin/c++ /usr/bin/c++
[root@01314.CN ~]# ln -s /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++ [root@01314.CN ~]# gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

CENTOS 6 通过YUM升级GCC到4.7/4.8的更多相关文章

  1. 通过yum升级gcc/g++至版本4.8.2

    最近在坐一个日期处理的问题,需要安装sxtwl模块,但是gcc版本4.7死活也安装不上,最后测试到只能升级gcc版本到4.8才得以解决 [root@123 bin]# gcc -vUsing buil ...

  2. 为CentOS 6、7升级gcc至4.8、4.9、5.2、6.3、7.3等高版本

    CentOS 7虽然已经出了很多年了,但依然会有很多人选择安装CentOS 6,CentOS 6有些依赖包和软件都比较老旧,如今天的主角gcc编译器,CentOS 6的gcc版本为4.4,CentOS ...

  3. 在CentOS 7.2下升级gcc编译器的版本

    默认情况下,CentOS 7.2预装的gcc版本是4.8.x,通过执行命令 gcc -v 可以看到,一般情况下这个版本的编译器已经满足需要了,但是某些特殊的时候为了支持C++更高的特性,需要对gcc编 ...

  4. CentOS yum升级GCC到4.8

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

  5. centOS 6.5 yum升级 gcc4.8 然后又退回来4.4

    CentOS 6.5 用了很多年了,一直舍不得省7 . 由于要用到 c++ 11 ,所以决定升级一下. 为了省事我选择用 yum 方式升级,结果最后还是不能用,差点搞坏,这是真机,重装麻烦了. get ...

  6. Linux-使用 yum 升级 gcc 到 4.8

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

  7. CentOS 6通过yum升级Git

    By francis_hao    Mar 9,2017   在一个新机器上推送代码到github上时出现了下面的问题 error: The requested URL returned error: ...

  8. CentOS 6.6 升级GCC G++ (当前最新版本为v6.1.0) (完整)

    ---恢复内容开始--- CentOS 6.6 升级GCC G++ (当前最新GCC/G++版本为v6.1.0) 没有便捷方式, yum update....   yum install 或者 添加y ...

  9. 转载:Centos升级gcc

    一.检查centos 里面是否安装了gcc g++ 输入命令:rpm -qa|grep gcc*有看到就出来gcc的东西就是装了没有的话就yum install gcc* -y 二.升级gcc 对于C ...

随机推荐

  1. linux 运维基础测验题

    第一题:创建一个目录/data --> mkdir /data eg: ls  -d 显示命令    -l 详细信息    -a 显示所有文件 cd 打开目录 pwd 显示当前目录 第二题:在/ ...

  2. Java基础19-封装、方法重载、构造方法(构造函数)

    1.封装 封装就是把不想或者不该告诉别人的东西隐藏起来,把可以告诉别人的公开 做法:修改属性的访问权限来限制对属性的访问.并为每一个属性创建一对取值方法和赋值方法,用于对这些属性的访问 class D ...

  3. [转]Oracle ROWNUM用法和分页查询总结

    本文转自:http://blog.csdn.net/fw0124/article/details/42737671 ****************************************** ...

  4. [转]NLog Layout Renderers ${}

    https://github.com/nlog/NLog/wiki/Layout-Renderers Layout renderers are template macros that are use ...

  5. 项目搭建系列之二:SpringMVC框架下配置MyBatis

    1.什么是MyBatis? MyBatis是一个支持普通SQL查询,存储过程和高级映射的优秀持久层框架.MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及对结果集的检索封装.MyBatis ...

  6. java使用poi.3.10读取excel 2007以上版本(xlsx格式)

    1.在使用过程中,一直报错 throw new ClassNotFoundException(name);原因:没有导入xmlbeans-2.6.0.jar包,建议在使用poi时,将所有包都导入进工程 ...

  7. Quartz使用及注意事项

    Quartz使用及注意事项 前提:目前由于公司业务决定,大量使用Quartz,每天固定的时间点执行相应的业务逻辑,,几十个时间点应该是有的,某一个时间点如果没有执行带来的问题是巨大的.Quartz的稳 ...

  8. python的返回值

    1.返回值的作用 函数并非总是直接显示输出,相反,它可以处理一些数据,并返回一个或一组值.函数返回的值被称为返回值.在函数中,可使用return语句将值返回到调用函数的代码行.返回值让你能够将程序的大 ...

  9. 用于模式匹配的String方法和RegExp方法

    上一节总结了创建正则表达式的语法,这一篇笔者总结了用于模式匹配的String四个方法:search().replace().match().split()以及用于模式匹配的RegExp两个方法exec ...

  10. spring boot 2.0.0 + mybatis 报:Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    spring boot 2.0.0 + mybatis 报:Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required 无法启动 ...