试了很多,最快解决办法的
安装好CenOS7后,自带的yum不能直接使用,使用会出现如下问题:
已加载插件:fastestmirror, langpacks File contains no section headers. file: file:///etc/yum.repos.d/convirt.repo, line: 1 "<html><head><title>Loading...</title></head><body><script type='text/javascript'>window.location.replace('http://www.convirture.c
删除原有的文件:
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
如果上述方法没有解决,尝试下面:
删除yum.repos.d目录下所有文件
rm -f /etc/yum.repos.d/*
然后重新下载阿里的:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清理缓存:
yum clean all
测试下载安装:
yum install gcc