CentOS变更yum源(阿里云yum源)

不羁的心 提交于 2020-02-28 11:19:42
将默认yum源变更为国内yum源可以减少由于网络因素无法快速下载依赖库的问题。

1、备份默认yum源配置文件CentOS-Base.repo
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak

2、下载阿里云yum源配置文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、清理yum缓存headers和rpm包
yum clean all

4、构建包信息缓存(可省略)
yum makecache

5、查看已开启的yum源
yum repolist
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!