centos7安装gcc,yum报错Repository base is listed more than once in the configuration
yum 安装gcc时报错:
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
查了各种资料,没解决,最后发现了错误原因(只是其中一种原因);
蓝色框:这些错误尝试各种解决仍无效。
红色框:最后发现是yum 被占用了。论看全部信息的重要性
绿色框:果然yum被占用 kill 掉
配置阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
安装gcc
yum -y install gcc gcc-c++ kernel-devel
查看gcc
gcc -v
离线安装未尝试
镜像库下载下列包 http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/
mpfr-3.1.1-4.el7.x86_64.rpm libmpc-1.0.1-3.el7.x86_64.rpm kernel-headers-3.10.0-123.el7.x86_64.rpm glibc-headers-2.17-55.el7.x86_64.rpm glibc-devel-2.17-55.el7.x86_64.rpm cpp-4.8.2-16.el7.x86_64.rpm gcc-4.8.2-16.el7.x86_64.rpm
安装
rpm -Uvh *.rpm --nodeps --force