yum install gcc-c++
centos 使用yum安装gcc时报了这个错
百度一搜是yum的镜像文件太旧了,DNS解析有问题。
可解决的方法有两个,一个是更新yum,一个是修改DNS。
这里记录一个更新yum方式的方法。
cd /etc/yum.repos.d/
下载新的CentOS-Base.repo 到/etc/yum.repos.d/,不同系统版本下载不同
5.*的下载连接:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
6.*的下载连接:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
7.*的下载连接:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo我
本人下载完后,就可以用了。参考的文章还作了update操作。
[root@localhost ~]# rpm -e rpmforge-release --nodeps
[root@localhost ~]# yum clean all
[root@localhost ~]# yum update
至此搞定。