linux安装gcc

方法:输入命令:

 

:(1) :yum -y install gcc
(2) yum -y install gcc-c++
(3)yum install make

我的再输入  yum -y install gcc 时候报错了: 

[root@cddserver2 ~]# yum -y install gcc-*
Loaded plugins: fastestmirror, presto
Could not retrieve mirrorlist 
http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

原因:
 dns服务器没有配置正确

解决办法:
1、打开文件/etc/resolv.conf在其中添加:
 nameserver 8.8.8.8
 nameserver 8.8.4.4
 search localdomain

2、然后重启网卡:使用命令: service network restart

然后输入:

:(1) :yum -y install gcc

(2) yum -y install gcc-c++
(3)yum install make

posted @ 2014-02-11 14:53  aspirant  阅读(2362)  评论(0编辑  收藏  举报