RHEL5.1下安装GCC
RHEL5.1下安装GCC编译环境
我安装时用的是默认安装,所以说GCC也没有装进去。
GCC在安装源码包时要用到的一个组件,
开始安装:按顺序安装以下包就可以完成GCC的安装了
[root@rhel5 Server]# rpm -ivh kernel-headers-2.6.18-53.el5.i386.rpm
[root@rhel5 Server]# rpm -ivh glibc-headers-2.5-18.i386.rpm
[root@rhel5 Server]# rpm -ivh glibc-devel-2.5-18.i386.rpm
[root@rhel5 Server]# rpm -ivh libgomp-4.1.2-14.el5.i386.rpm
[root@rhel5 Server]# rpm -ivh gcc-4.1.2-14.el5.i386.rpm
[root@rhel5 Server]# rpm -ivh libstdc++-devel-4.1.2-14.el5.i386.rpm
[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:
MSN:ky.hack@live.cn
QQ:170023480
阅读(1534) | 评论(0) | 转发(0) |