Centos6使用yum源报错(请保证你的网络是通的)
说明:Centos的官方已经停止对Centos6的服务了,不过还是为老用户提供了一种更新方法(不建议使用,国外太慢,我就不写了)。我们来使用国内的资源,我这里使用阿里的,如下:
Centos6更改为阿里的vault源:
第一步:关闭fastestmirrors
执行命令:vi /etc/yum/pluginconf.d/fastestmirror.conf
修改:enabled=0
第二步:备份CentOS-Base.repo
执行命令:cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
第三步:替换成阿里的vault镜像
执行命令:wget -O /etc/yum.repos.d/CentOS-Base.repo https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Centos-6-Vault-Aliyun.repo
备用说明:如果你没有wget。那可执行下面的命令curl开头进行安装
执行命令:curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
第四步:执行下面两个命令:清空去掉缓存
命令1:yum clean all
命令2:yum makecache
如果想安装官方镜像可以参考这位大神的文章:https://www.liuzhanwu.cn/29909.html