Centos7.6 gcc 4.8升级至7.3

腾讯云主机安装的是gcc 4.8.5:
在这里插入图片描述
目标:升级至gcc 7.3版本:
root用户下执行:

[root@VM-4-17-centos boost]# yum -y install centos-release-scl
[root@VM-4-17-centos boost]# yum install devtoolset-7-gcc*


执行成功后,查找刚刚安装的gcc:find / -name gcc
在这里插入图片描述
可以看到刚刚安装的gcc都在/opt/rh/devtoolset-7/root/usr/bin目录下
将原来的/usr/bin/gcc备份一下,创建软链接到我们刚刚安装的gcc 7上:
在这里插入图片描述

[root@VM-4-17-centos boost]# mv /usr/bin/gcc /usr/bin/gcc-4.8
[root@VM-4-17-centos boost]# mv /usr/bin/g++ /usr/bin/g++-4.8
[root@VM-4-17-centos boost]# ln -s /opt/rh/devtoolset-7/root/usr/bin/gcc /usr/bin/gcc
[root@VM-4-17-centos boost]# ln -s /opt/rh/devtoolset-7/root/usr/bin/g++ /usr/bin/g++
[root@VM-4-17-centos boost]# mv /usr/bin/cc /usr/bin/cc-4.8
[root@VM-4-17-centos boost]# mv /usr/bin/c++ /usr/bin/c++-4.8
[root@VM-4-17-centos boost]# ln -s /usr/bin/gcc /usr/bin/cc
[root@VM-4-17-centos boost]# ln -s /usr/bin/g++ /usr/bin/c++
[root@VM-4-17-centos boost]# gcc --version

升级完成。

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

高二的笔记

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值