Red Hat 6.3安装gcc gc++

转自http://blog.csdn.net/quantyongan/article/details/38494193,亲测可用

首先安装gcc需要相应的rpm依赖包,在安装系统的镜像文件中就有这些rpm包

首先在光驱中选择系统的安装包载入


如果桌面显示有如下的光驱


说明是已经载入了镜像,这时候,需要挂载一下镜像到mnt目录

先在/mnt中创建一个文件夹 cdrom 

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    mkdir /mnt/cdrom  
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    mount /dev/cdrom /mnt/cdrom  
进入到 /mnt/cdrom目录
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    cd /mnt/cdrom  
进入到Packages目录
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    cd Packages  
使用如下命令查找相应的rpm包
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep glibc   

  • glibc-common-2.12-1.80.el6.x86_64.rpm
  • glibc-2.12-1.80.el6.x86_64.rpm
  • glibc-headers-2.12-1.80.el6.x86_64.rpm
  • glibc-devel-2.12-1.80.el6.x86_64.rpm

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep kernel   

  • kernel-headers-2.6.32-279.el6.x86_64.rpm 

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep libgcc  

  • libgcc-4.4.6-4.el6.x86_64.rpm  

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep libgomp  

  • libgomp-4.4.6-4.el6.x86_64.rpm

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep nscd  

  • nscd-2.12-1.80.el6.x86_64.rpm

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep mpfr  

  • mpfr-2.4.1-6.el6.x86_64.rpm

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep ppl  

  • ppl-0.10.2-11.el6.x86_64.rpm

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep cloog  

  • cloog-ppl-0.15.7-1.2.el6.x86_64.rpm

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep cpp  

  • cpp-4.4.6-4.el6.x86_64.rpm

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep gcc  

  • gcc-4.4.6-4.el6.x86_64.rpm
  • gcc-c++-4.4.6-4.el6.x86_64.rpm

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    ls -l |grep libstdc++-  

  • libstdc++-4.4.6-4.el6.x86_64.rpm
  • libstdc++-devel-4.4.6-4.el6.x86_64.rpm

找到这些安装包之后,记住,一定要按照以下的顺序安装,否则可能会出现错误

rpm -ivh glibc-common-2.12-1.80.el6.x86_64.rpm
rpm -ivh kernel-headers-2.6.32-279.el6.x86_64.rpm
rpm -ivh libgcc-4.4.6-4.el6.x86_64.rpm
rpm -ivh glibc-2.12-1.80.el6.x86_64.rpm
rpm -ivh libgomp-4.4.6-4.el6.x86_64.rpm
rpm -ivh nscd-2.12-1.80.el6.x86_64.rpm
rpm -ivh glibc-headers-2.12-1.80.el6.x86_64.rpm
rpm -ivh glibc-devel-2.12-1.80.el6.x86_64.rpm
rpm -ivh mpfr-2.4.1-6.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 cpp-4.4.6-4.el6.x86_64.rpm
rpm -ivh gcc-4.4.6-4.el6.x86_64.rpm
rpm -ivh libstdc++-4.4.6-4.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.6-4.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.6-4.el6.x86_64.rpm


最后通过which命令或者rpm -q 查看一下GCC是否已安装:
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    which gcc   
  2. $    rpm -q gcc  

结束后,最好是能够卸载镜像

[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. $    umount /mnt/cdrom/  

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值