RHEL5.1下安装GCC编译环境

RHEL5.1 下安装 GCC 编译环境
 
我安装时用的是默认安装,所以说 GCC 也没有装进去。
GCC 在安装源码包时要用到的一个组件,
开始安装:按顺序安装以下包就可以完成 GCC 的安装了
1)        [root@rhel5 Server]# rpm -ivh kernel-headers- 2.6.18 -53.el5.i386.rpm
2)        [root@rhel5 Server]# rpm -ivh glibc-headers-2.5-18.i386.rpm
3)        [root@rhel5 Server]# rpm -ivh glibc-devel-2.5-18.i386.rpm
4)        [root@rhel5 Server]# rpm -ivh libgomp- 4.1.2 -14.el5.i386.rpm
5)        [root@rhel5 Server]# rpm -ivh gcc- 4.1.2 -14.el5.i386.rpm
6)        [root@rhel5 Server]# rpm -ivh libstdc++-devel- 4.1.2 -14.el5.i386.rpm
7)        [root@rhel5 Server]# rpm -ivh gcc-c++- 4.1.2 -14.el5.i386.rpm 
 
 
 
下面的是我安装时的日志:
[root@rhel5 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
        libgomp = 4.1.2 -14.el5 is needed by gcc-4.1.2-14.el5.i386
        libgomp.so.1 is needed by gcc- 4.1.2 -14.el5.i386
// 安装 GCC 需要先安装 glibc-devel libgomp 这两个包。
 
[root@rhel5 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
error: Failed dependencies:
        glibc-headers is needed by glibc-devel-2.5-18.i386
        glibc-headers = 2.5-18 is needed by glibc-devel-2.5-18.i386
// 安装 glibc-devel 这个包需要 glibc-headers 的依赖;
 
[root@rhel5 Server]# rpm -ivh glibc-headers-2.5-18.i386.rpm
warning: glibc-headers-2.5-18.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
        kernel-headers is needed by glibc-headers-2.5-18.i386
        kernel-headers >= 2.2.1 is needed by glibc-headers-2.5-18.i386
// 安装 glibc-headers 这个包需要 kernel-headers 的依赖;
 
PS :汗一个。。。还错综复杂。。。。。
 
 [root@rhel5 Server]# rpm -ivh kernel-headers- 2.6.18 -53.el5.i386.rpm
warning: kernel-headers- 2.6.18 -53.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:kernel-headers         ########################################### [100%]
 [root@rhel5 Server]# rpm -ivh glibc-headers-2.5-18.i386.rpm
warning: glibc-headers-2.5-18.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:glibc-headers          ########################################### [100%]
 [root@rhel5 Server]#
[root@rhel5 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%]
[root@rhel5 Server]# rpm -ivh gcc-
gcc- 4.1.2 -14.el5.i386.rpm           gcc-java-4.1.2-14.el5.i386.rpm
gcc-c++- 4.1.2 -14.el5.i386.rpm       gcc-objc-4.1.2-14.el5.i386.rpm
gcc-gfortran- 4.1.2 -14.el5.i386.rpm  gcc-objc++-4.1.2-14.el5.i386.rpm
gcc-gnat- 4.1.2 -14.el5.i386.rpm
[root@rhel5 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:
        libgomp = 4.1.2 -14.el5 is needed by gcc-4.1.2-14.el5.i386
        libgomp.so.1 is needed by gcc- 4.1.2 -14.el5.i386
// 晕还有一个, GCC 包依赖 libgomp 包,先装吧。
 
[root@rhel5 Server]# rpm -ivh libgomp- 4.1.2 -14.el5.i386.rpm
warning: libgomp- 4.1.2 -14.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:libgomp                ########################################### [100%]
 [root@rhel5 Server]# rpm -ivh gcc- 4.1.2 -14. 86.rpm: Head el5.i386.rpm
warning: gcc- 4.1.2 -14.el5.i3er V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:gcc                    ########################################### [100%]
[root@rhel5 Server]#
 
PS :呼。。。。终于装上了。
 
  接着安装 gcc-c++- 4.1.2 -14.el5.i386.rpm 吧。
 
[root@rhel5 Server]# rpm -ivh gcc-c++- 4.1.2 -14.el5.i386.rpm
warning: gcc-c++- 4.1.2 -14.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 3                                                                              7017186
error: Failed dependencies:
        libstdc++-devel = 4.1.2 -14.el5 is needed by gcc-c++-4.1.2-14.el5.i386
// 还好,只有一个依赖。。。
 [root@rhel5 Server]# rpm -ivh libstdc++-devel- 4.1.2 -14.el5.i386.rpm
warning: libstdc++-devel- 4.1.2 -14.el5.i386.rpm: Header V3 DSA signature: NOKEY,                                                                               key ID 37017186
Preparing...                ########################################### [100%]
   1:libstdc++-devel        ########################################### [100%]
 [root@rhel5 Server]# rpm -ivh gcc-c++- 4.1.2 -14.el5.i386.rpm                                                                                                   warning: gcc-c++-4.1.2-14.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 3                                                                              7017186
Preparing...                ########################################### [100%]
   1:gcc-c++                ########################################### [100%]
 
OK 大功告成。
 
 
 
总结:安装时注意看提示,看提示需要先安装那一个包。要学会分析,一步一步的装就可以搞定了。如:
[root@rhel5 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 
// 意思是 gcc- 4.1.2 -14.el5.i386 依赖于 glibc-devel ,必要先安装 glibc-devel
        libgomp = 4.1.2 -14.el5 is needed by gcc-4.1.2-14.el5.i386  
 // 意思是 gcc- 4.1.2 -14.el5.i386 依赖于 glibc-devel ,必要先安装 libgomp
        libgomp.so.1 is needed by gcc- 4.1.2 -14.el5.i386
这里面就有两个依赖包,只有把它安装好了之后才能安装 GCC
 
Blog http://hi.baidu.com/kyhack
QQ 170023480

你可能感兴趣的:(gcc,职场,休闲)