centos6 无法使用yum命令

因为centos官方停止对6的更新维护导致yum镜像源无法使用,解决办法如下:

1.关闭fastestmirror

vi /etc/yum/pluginconf.d/fastestmirror.conf

#修改参数

enable=0

2.修改原有镜像名称

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

3.更换源

#替换为阿里云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

4.备份epel源

mv   /etc/yum.repos.d/epel-repo epel.repo_bak

5.缓存yum源

yum clean all

yum makecache


猜你喜欢

转载自blog.51cto.com/13131218/2672147