通过yum安装软件老是报错,打算重新安装yum
如果自己Centos 6.8的系统yum源出现问题了,如何才能修复?
方式一:使用国内的阿里云镜像
(1)把 /etc/yum.repos.d/ 下面所有的源给删除掉了
(2)下载镜像
# CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
注意如果没有安装wget,可以从下面的网址中先手动下载,然后上传到linux上安装:http://www.rpmfind.net/linux/rpm2html/search.php?query=wget
(3)执行命令,重新生成cache
yum clean all
yum makecache 执行这个需要一段时间
参考链接:https://blog.csdn.net/u010454030/article/details/78807281