Centos 7 升级GCC时遇到 mirrorlist.centos.org; Unknown error“

问题描述

在执行如下操作的时候,

复制代码
yum install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils

出现:

14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

网上搜索了一下,原因是 mirrorlist.centos.org 这个源停用了。哎~

建议还是用乌班图或者centos-8吧。

解决方法

centos7上的解决办法

使用如下的yum 源

CentOS-Base.repo

复制代码
[base]
name=CentOS-$releasever - Base
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=https://vault.centos.org/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

# released updates
[updates]
name=CentOS-$releasever - Updates
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=https://vault.centos.org/6.10/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

# additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=https://vault.centos.org/6.10/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

CentOS-SCLo-scl.repo

参考了Linux CentOs7系统scl镜像源失效问题_centos-sclo-scl-rh.repo-CSDN博客这个博客,感谢。

复制代码
# CentOS-SCLo-sclo.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information

[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=http://vault.centos.org/centos/7/sclo/$basearch/rh/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo


[centos-sclo-sclo-testing]
name=CentOS-7 - SCLo sclo Testing
baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/sclo/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-sclo-source]
name=CentOS-7 - SCLo sclo Sources
baseurl=http://vault.centos.org/centos/7/sclo/Source/sclo/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

[centos-sclo-sclo-debuginfo]
name=CentOS-7 - SCLo sclo Debuginfo
baseurl=http://debuginfo.centos.org/centos/7/sclo/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

yum clean all
yum makecache

下面就能正常升级了

复制代码
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
 
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile

祝你好运

有问题可以交流呀

concat("求求QUN", "61480", "9646")

相关推荐
潘yi.14 分钟前
Haproxy搭建web群集
运维·服务器·haproxy
我自飞扬临天下37 分钟前
JMeter接口自动化脚本框架
运维·jmeter·自动化
Johny_Zhao1 小时前
Burp Suite 企业级深度实战教程
linux·网络·网络安全·信息安全·云计算·shell·burp suite·系统运维·itsm
东临碣石821 小时前
【AI论文】论文转海报:迈向从科学论文到多模态海报的自动化生成
运维·人工智能·自动化
良辰美景好时光1 小时前
keepalived定制日志bug
linux·运维·bug
s_little_monster2 小时前
【Linux】网络--网络层--IP协议
linux·运维·网络·经验分享·笔记·学习·tcp/ip
forward_huan2 小时前
wsl安装linux
linux·wsl
西阳未落2 小时前
Linux(10)——第二个小程序(自制shell)
linux·运维·服务器
chiou7222 小时前
为 Ubuntu 安装的软件创建桌面图标
linux·ubuntu·lua
binary思维3 小时前
Ubuntu挂起和休眠
linux·运维·ubuntu