安装好CentOS 7后,yum安装gcc出现File contains no section headers. file: file:///etc/yum.repos.d/CentOS-Base.r
可能是yum源不能用,重新下载源
解决方法:
删除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 -y install gcc