首页 > 技术文章 > 关于centos中yum不能使用

mengang 2020-05-04 09:17 原文

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
 

然后就可以了

 

推荐阅读