RedHat Enterprise Linux AS4&5 安装gcc过程

三、Gcc安装方法(redhat 4):

一、安装步骤

1、使用which gcc命令查看gcc是否安装安装

2、如若没有安装则下载如下安装包,所需安装包如下

一共需要拷贝以下五个安装包:

binutils-2.13.90.0.18-9.i386.rpm

glibc-devel-2.3.2-11.9.i386.rpm

cpp-3.2.2-5.i386.rpm

glibc-kernheaders-2.4-8.10.i386.rpm

gcc-3.2.2-5.i386.rpm

 

安装顺序如下:(如若在rpmp安装过程中出现依赖关系,则增加—nodeps参数)

Rpm –ivh binutils-2.13.90.0.18-9.i386.rpm

Rpm -ivh cpp-3.2.2-5.i386.rpm

Rpm -ivh glibc-kernheaders-2.4-8.10.i386.rpm

Rpm -ivh glibc-devel-2.3.2-11.9.i386.rpm

Rpm -ivhgcc-3.2.2-5.i386.rpm

 

RedHat Enterprise Linux 5 安装GCC过程:

 

 

Red Hat Enterprise 5默认是不安装gcc的,需要自己手动安装。gcc所需要的包都可以在安装光盘上找到,至于最新的gcc可以在http://gcc.gnu.org/ 下载,但是是以源码的形式压缩的,需要对其进行编译。

 

Solution
  1、插入安装盘,首先在/mnt下创建cdrom文件夹,然后挂载安装盘:mount /dev/cdrom /mnt/cdrom;

 

  2、进入/mnt/cdrom/Server,按顺序安装以下包:

 

(1)安装kernel-headers-2.6.18-128.el5.i386.rpm

 

[root@localhost Server]# rpm -ivh ./kernel-headers-2.6.18-128.el5.i386.rpm

 

warning: ./kernel-headers-2.6.18-128.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

 

Preparing... ########################################### [100%]

 

1:kernel-headers ########################################### [100%]

 

(2)安装glibc-headers-2.5-34.i386.rpm

 

[root@localhost Server]# rpm -ivh ./glibc-headers-2.5-34.i386.rpm

 

warning: ./glibc-headers-2.5-34.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

 

Preparing... ########################################### [100%]

 

1:glibc-headers ########################################### [100%]

 

(3)安装glibc-devel-2.5-34.i386.rpm

 

[root@localhost Server]# rpm -ivh ./glibc-devel-2.5-34.i386.rpm

 

warning: ./glibc-devel-2.5-34.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

 

Preparing... ########################################### [100%]

 

1:glibc-devel ########################################### [100%]

 

(4)安装libgomp-4.3.2-7.el5.i386.rpm

 

[root@localhost Server]# rpm -ivh ./libgomp-4.3.2-7.el5.i386.rpm

 

warning: ./libgomp-4.3.2-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

 

Preparing... ########################################### [100%]

 

1:libgomp ########################################### [100%]

 

(5)安装rpm -ivh gcc-4.1.2-44.el5.i386.rpm

 

[root@localhost Server]# rpm -ivh gcc-4.1.2-44.el5.i386.rpm

 

warning: gcc-4.1.2-44.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

 

Preparing... ########################################### [100%]

 

1:gcc ########################################### [100%]

 

(6)安装libstdc++-devel-4.1.2-44.el5.i386.rpm

 

[root@localhost Server]# rpm -ivh ./libstdc++-devel-4.1.2-44.el5.i386.rpm

 

warning: ./libstdc++-devel-4.1.2-44.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

 

Preparing... ########################################### [100%]

 

1:libstdc++-devel ########################################### [100%]

 

(7)安装gcc-c++-4.1.2-44.el5.i386.rpm

 

[root@localhost Server]# rpm -ivh ./gcc-c++-4.1.2-44.el5.i386.rpm

 

warning: ./gcc-c++-4.1.2-44.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

 

Preparing... ########################################### [100%]

 

1:gcc-c++ ########################################### [100%]

 

 此过程中有可能需要安装其他的安装包, 如下:
[root@localhost Server]# rpm -ivh gcc-4.1.2-14.el5.i386.rpm 
warning: gcc-4.1.2-14.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
        glibc-devel >= 2.2.90-12 is needed by gcc-4.1.2-14.el5.i386

 

找到相应的安装包安装即可

 

[root@localhost Server]# rpm -ivh gcc-4.1.2-14.el5.i386.rpm 
warning: gcc-4.1.2-14.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
        glibc-devel >= 2.2.90-12 is needed by gcc-4.1.2-14.el5.i386
[root@localhost Server]# rpm -ivh glibc-devel-2.5-18.i386.rpm 
warning: glibc-devel-2.5-18.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:glibc-devel            ########################################### [100%]

 

3、最后进入/mnt,输入rpm –qa gcc* ,如果成功安装了gcc,可以查出以下内容:

 

binutils-2.13.90.0.18-9.i386.rpm

 

cpp-3.2.2-5.i386.rpm

 

技术改变世界! --狂诗绝剑
上一篇:fragment类onresume里面刷新操作处理


下一篇:物联网开发者调查:适用于物联网的编程语言和操作系统