如何在 Centos7 中使用阿里云的yum源

痴心易碎 提交于 2020-02-17 13:57:53

如何在 Centos7 中使用阿里云的yum源

1. 备份原来的yum源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

 

2. 下载阿里云的CentOS-Base.repo 到/etc/yum.repos.d/

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

或者

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

执行结果如下图:

 

3. 清理缓存

sudo yum clean all

执行结果:

 

4. 生成新的缓存

sudo yum makecache

执行结果:

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