centos6.5系统怎么安装gcc

在线安装

使用yum安装,注意安装时要先成为root用户。

安装gcc命令如下:

yum install gcc

(推荐教程:centos使用教程)

离线安装

首先到http://vault.centos.org/6.5/os/x86_64/Packages/下载用到的rpm包。

包括:ppl-0.10.2-11.el6.x86_64.rpm 、cloog-ppl-0.15.7-1.2.el6.x86_64.rpm 、mpfr-2.4.1-6.el6.x86_64.rpm 、cpp-4.4.6-4.el6.x86_64.rpm 、kernel-headers-2.6.32-279.el6.x86_64.rpm 、glibc-headers-2.12-1.80.el6.x86_64.rpm 、glibc-devel-2.12-1.80.el6.x86_64.rpm 、libstdc++-devel-4.4.6-4.el6.x86_64.rpm 、gcc-4.4.6-4.el6.x86_64.rpm 、gcc-c++-4.4.6-4.el6.x86_64.rpm

安装命令如下:

rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm 
rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm 
rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm 
rpm -ivh cpp-4.4.7-4.el6.x86_64.rpm 
rpm -ivh kernel-headers-2.6.32-431.el6.x86_64.rpm 
rpm -ivh glibc-headers-2.12-1.132.el6.x86_64.rpm 
rpm -ivh glibc-devel-2.12-1.132.el6.x86_64.rpm 
rpm -ivh gcc-4.4.7-4.el6.x86_64.rpm 
rpm -ivh libstdc++-devel-4.4.7-4.el6.x86_64.rpm 
rpm -ivh gcc-c++-4.4.7-4.el6.x86_64.rpm

一定要按顺序进行安装,部分安装提示already installed,没关系。

如遇Error 在安装时后面加:加上参数 –nodeps –force

rpm -ivh ppl-0.10.2-11.el6.x86_64.rpm  --nodeps  --force
rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm  --nodeps  --force
rpm -ivh mpfr-2.4.1-6.el6.x86_64.rpm  --nodeps  --force
rpm -ivh cpp-4.4.7-4.el6.x86_64.rpm  --nodeps  --force
rpm -ivh kernel-headers-2.6.32-431.el6.x86_64.rpm  --nodeps  --force
rpm -ivh glibc-headers-2.12-1.132.el6.x86_64.rpm  --nodeps  --force
rpm -ivh glibc-devel-2.12-1.132.el6.x86_64.rpm  --nodeps  --force
rpm -ivh gcc-4.4.7-4.el6.x86_64.rpm  --nodeps  --force
rpm -ivh libstdc++-devel-4.4.7-4.el6.x86_64.rpm  --nodeps  --force
rpm -ivh gcc-c++-4.4.7-4.el6.x86_64.rpm  --nodeps  --force

执行完,gcc就安装成功了。

相关视频教程推荐:linux视频教程