宋子宪博客

运行yum install 命令报错如下: File contains no section headers. 解决方案:

运行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  

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »