唐僧喜欢小龙女

导航

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

原文 https://www.cnblogs.com/lpbottle/p/7875400.html

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

 

5. 更新yum 

yum update

posted on 2019-11-11 11:57  与时具进&不忘初心  阅读(130)  评论(0编辑  收藏  举报