Linux:centos7更新yum国内源

版权声明:原创内容,欢迎转载 https://blog.csdn.net/weixin_43731793/article/details/91352486

安装步骤

1、首先备份/etc/yum.repos.d/CentOS-Base.repo

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

2、进入/etc/yum.repos.d/

cd /etc/yum.repos.d/

3、下载对应版本 repo 文件, 放入 /etc/yum.repos.d/ (操作前请做好相应备份)

CentOS5 :http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS6 :http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS7 :

http://mirrors.aliyun.com/repo/Centos-7.repo
http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
http://ftp.sjtu.edu.cn/centos/
http://centos.ustc.edu.cn
http://mirrors.163.com/.help/CentOS7-Base-163.repo
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

4、修改CentOS7-Base-163.repo为CentOS-Base.repo

mv /etc/yum.repos.d/CentOS7-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo

4、运行以下命令生成缓存

yum clean all
yum makecache

5、更新yum

yum update

猜你喜欢

转载自blog.csdn.net/weixin_43731793/article/details/91352486