运行yum install 报错如下File contains no section headers解决方案
步骤1
删除yum.repos.d目录下所有文件

rm -f /etc/yum.repos.d/*  

步骤2
然后重新下载阿里的镜像

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo  

步骤3
清理缓存

yum clean all

步骤4
测试下载安装

yum install gcc  
Last modification:September 12, 2019
如果觉得这篇技术文章对你有用,请随意赞赏