CentOS更换阿里软件源 2020-07-25

2020-07-25  本文已影响0人  Happy_Hung

1. 备份原文件

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

2. 生成新文件

2.1 centos7.x
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2.2 centos6.x
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
2.1 centos5.x
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

3. 更新cache

yum makecache

上一篇 下一篇

猜你喜欢

热点阅读