centos更换阿里云源

风水道人 2024-10-04 11:37:02 阅读 97

1.出现问题就更换源就可以了

<code>Loading mirror speeds from cached hostfile Could not retrieve mirrorlist httcode>

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

关于CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"问题,已解决

在CentOS系统中更换为阿里云源可以通过以下步骤进行

1.备份当前的YUM源配置文件

sudo cp -a /etc/yum.repos.d /etc/yum.repos.d.backup

2.清理原有的YUM源配置文件

sudo rm -f /etc/yum.repos.d/*.repo

3.下载阿里云的YUM源配置文件

sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

4.清除缓存并生成新的缓存

sudo yum clean all

sudo yum makecache



声明

本文内容仅代表作者观点,或转载于其他网站,本站不以此文作为商业用途
如有涉及侵权,请联系本站进行删除
转载本站原创文章,请注明来源及作者。