系统: centos7 x86_64
查看本机源: yum repolist all
备份源文件: mv /etc/yum.repos.d/CentOS-Base.repo{,.bar}
转到源目录, 按照自己的版本下载源, 我是 CentOS 7, 使用命令:
- cd /etc/yum.repos.d/
- wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
下载的源替换老的源文件:
mv CentOS7-Base-163.repo CentOS-Base.repo
最后刷新:
- yum clean all(清除资源)
- yum makecache(建立 yum 资源缓存)
- yum update
来源: http://www.bubuko.com/infodetail-2921164.html