centos7.6上升级gcc版本记录

1、编辑/etc/resolv.conf, 保证能ping通外网,如baidu

2、直接参考如下帖子,我没有成功,不知道啥原因

Centos7 安装gcc8的步骤(2024年6月30日后)_centos7安装gcc8-CSDN博客

https://blog.csdn.net/qq_45972323/article/details/144328345

报没有找到包

3、于是尝试先装centos-release-scl,再装gcc

但是装gcc的时候,还是报错:

4、更换yum源不成功

[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2523  100  2523    0     0  24279      0 --:--:-- --:--:-- --:--:-- 24735
[root@localhost ~]# um clean all
-bash: um: command not found
[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base centos-sclo-rh centos-sclo-sclo extras updates
Cleaning up list of fastest mirrors
[root@localhost ~]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-rh error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

5、这是再按照那个帖子搞下,成功了!

[root@localhost ~]# yum install devtoolset-8
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check

(详细过程不记录了)

Total download size: 95 M
Is this ok [y/d/N]: y
Downloading packages:

6、使能安装后的gcc

source /opt/rh/devtoolset-8/enable,并将其加入到~/.bashrc中

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值