1.查看 linux版本 cat /etc/centos-release
2.失败一般都是 yum源的问题 2020年12月2日正式将CentOS 6相关的软件源移出了官方源
解决:
1.首先把fastestmirrors关了,fastestmirror是yum的一个加速插件 enable=0禁用
#编辑 vi /etc/yum/pluginconf.d/fastestmirror.conf #修改 enable=0 #或者执行以下命令
sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
2.备份 CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
3. 替换为阿里云Vault镜像(国内服务器用)
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo
4. 好了试试吧 yum update