关于centos中yum不能使用

1.yum命令不能使用会报下面错误

已加载插件:fastestmirror, langpacks


File contains no section headers.
file: file:///etc/yum.repos.d/nginx.repo, line: 1
'nx-stable]\n'

解决方法

1.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
 

然后就可以了

猜你喜欢

转载自www.cnblogs.com/mengang/p/12825325.html
今日推荐