Linux------centos7如何将国外yum源更换成国内的(减量不减质版)

先直接上所有步骤:

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

yum install wget

wget -0 /etc/yum.repos.d/Cent0s-Base.repo http://mirrors.163.com/.help/Cent0s7-Base-163.repo

yum clean all

yum makecachefast

1.将原来的yum源拷贝以防出错

打开yum源所在的位置:cd /etc/yum.repos.d/

mv保存一下:mv CentOS-Base.repo CentOS-Base.repo .backup

2.安装一个工具:yum install wget

3.下载安装163网易的yum源

wget -0 /etc/yum.repos.d/Cent0s-Base.repo http://mirrors.163.com/.help/Cent0s7-Base-163.repo

4.清理所有的缓存和临时文件(防止因为之前的缓存而使寻找和安装软件包的速度降低、甚至出现某些未知错误):yum clean all

5.更新Yum软件包管理器的缓存:yum makecache fast

猜你喜欢

转载自blog.csdn.net/ZYK069/article/details/130984481