CentOS下yum命令报错File contains no section headers. file: file:///etc/yum.repos.d/

解决方法:

删除原有文件:rm -f /etc/yum.repos.d/CentOS-Base.repo

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

清楚缓存:yum clean all

再试试即可

posted @ 2023-12-21 17:25  y夏末y  阅读(138)  评论(0编辑  收藏  举报