Centos7更换源失败 file: file:///etc/yum.repos.d/。。。

[root@manager yum.repos.d]# yum makecache

Loaded plugins: fastestmirror, security
Error: File contains no section headers.

file: file:///etc/yum.repos.d/6CentOS-Base.repo, line: 1
' '

这是啥情况,问题在于你下载的不对,这里建议使用浏览器下载,然后上传至服务器。

[root@manager yum.repos.d]# file CentOS6-Base-163.repo 
CentOS6-Base-163.repo: ASCII English text

当你使用wget下载的时候,请确认下file出来是否为ASCII English text,必须是这个格式。

原因:在网络的出口有限制,导致异常!

原文地址:https://www.cnblogs.com/Erma/p/11240471.html