Centos yum无法使用的问题切换阿里云源
各种原因,Centos不再维护,以及国内网络环境限制,导致yum无法使用;
解决办法:
# 删除旧的repo
rm -rf /etc/yum.repos.d/*
# Centos 7
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# Centos 8
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
# 清理缓存
yum clean cache
yum makecache