博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
X Chen笔记---Centos通过yum的方式升级gcc/g++
阅读量:2395 次
发布时间:2019-05-10

本文共 2754 字,大约阅读时间需要 9 分钟。

原文链接:https://www.dwhd.org/20160724_085212.html

通过此方式升级gcc/g++,最好能从底到高一步步升级,即:Centos自带-4.8-4.9-5.2,升级过程如下:

gcc 4.8 安装

01
02
03
04
05
06
07
08
09
10
11
12
13
[root@DS-VM-Node239 ~]
# curl -Lks http://www.hop5.in/yum/el6/hop5.repo > /etc/yum.repos.d/hop5.repo
[root@DS-VM-Node239 ~]
# yum install gcc gcc-g++ -y
[root@DS-VM-Node239 ~]
# gcc --version
gcc
(GCC) 4.8.2 20131212 (Red Hat 4.8.2-8)
Copyright © 2013 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。
[root@DS-VM-Node239 ~]
# g++ --version
g++ (GCC) 4.8.2 20131212 (Red Hat 4.8.2-8)
Copyright © 2013 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。
[root@DS-VM-Node211 ~]
#

gcc 4.9 安装

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[root@DS-VM-Node239 ~]
# yum install centos-release-scl -y
[root@DS-VM-Node239 ~]
# yum install devtoolset-3-toolchain -y
[root@DS-VM-Node239 ~]
# scl enable devtoolset-3 bash
[root@DS-VM-Node239 ~]
# gcc --version
gcc
(GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
Copyright (C) 2014 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.
 
[root@DS-VM-Node239 ~]
# g++ --version
g++ (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
Copyright (C) 2014 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.
 
[root@DS-VM-Node239 ~]
# gfortran --version
GNU Fortran (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
Copyright (C) 2014 Free Software Foundation, Inc.
 
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For
more
information about these matters, see the
file
named COPYING
 
[root@DS-VM-Node239 ~]
#

gcc 5.2 安装

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
[root@DS-VM-Node239 ~]
# yum install centos-release-scl -y
[root@DS-VM-Node239 ~]
# yum install devtoolset-4-toolchain -y
[root@DS-VM-Node239 ~]
# scl enable devtoolset-4 bash
[root@DS-VM-Node239 ~]
# gcc --version
gcc
(GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)
Copyright (C) 2015 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.
 
[root@DS-VM-Node239 ~]
# g++ --version
g++ (GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)
Copyright (C) 2015 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.
 
[root@DS-VM-Node239 ~]
#

转载地址:http://xqwob.baihongyu.com/

你可能感兴趣的文章
Java编程思想学习笔记(12)
查看>>
Java编程思想学习笔记(13)
查看>>
Java编程思想学习笔记(14)
查看>>
Java-8-UnaryOperator
查看>>
Java-8-Function
查看>>
Java-8-Stream接口
查看>>
Junit4入门
查看>>
Java与算法(11)
查看>>
Java与算法(13)
查看>>
Python时间模块
查看>>
Python的闭包和装饰器
查看>>
Python基于Socket实现简单聊天室
查看>>
Python的Twisted入门
查看>>
Flask的表单处理
查看>>
Flask-Login的使用
查看>>
Python往MySQL存储图片
查看>>
Flask-SQlAIchemy管理数据库
查看>>
Flask-Migrate实现数据库迁移
查看>>
su: cannot set user id: Resource temporarily unavailable
查看>>
SSHException: Incompatible ssh peer (no acceptable kex algorithm)
查看>>