centos中修改yum源为阿里yum源

1、查看yum源信息

 yum repolist

 

 

 

2、切换到yum源配置文件目录

cd /etc/yum.repos.d

3、备份旧的yum源配置文件

sudo mv CentOS-Base.repo CentOS-Base.repo.bak

4、下载阿里的yum源文件

sudo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/Centos-7.repo

5、清理缓存

 yum clean all

6、重新生成缓存

yum makecache

7、再次查看yum源

yum repolist

 

 替换成功!

posted @ 2020-08-05 19:37  我要去巴萨  阅读(291)  评论(0编辑  收藏  举报