第一步:命令 vim /etc/yum/pluginconf.d/subscription-manager.conf 将这个enable注释掉
如果再次尝试报错:File contains no section headers,继续第二步:
第二步:
cd /etc/yum.repos.d/
删除所有文件:
rm -f /etc/yum.repos.d/*
重新下载阿里的
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清理缓存 yum clean all