关于在Linux装gcc没有kernel-headers包的问题

网上有很多

公司刚购买的VPS是swsoft做的操作系统模版,这个linux的模版做得很变态,gcc根本没有安装,只能用rpm包安装。虽然不装gcc,系统少了一个安全隐患,可是要安装一些需要编译安装或软件的最新版本是不可能的,源码安装还是*nix世界的王道。一般安装gcc是会提示要glibc,glibc->glibc-header,glibc-header->kernel-header 最后这个kernel-header用baidu真没找也找不到,还上了n多的挂了马的网站。最后用google.com在http://bluequartz.org/docs/fc1kit/gcc.html上找到的了解决办法,原来是要把gcc需要的几个包一起安装

rpm -ihv gcc-3.3.2-1.i386.rpm binutils-2.14.90.0.6-3.i386.rpm \
cpp-3.3.2-1.i386.rpm glibc-devel-2.3.2-101.i386.rpm \
glibc-headers-2.3.2-101.i386.rpm gcc32-3.2.3-6.i386.rpm \
glibc-kernheaders-2.4-8.36.i386.rpm

昨天正好碰到了一次,发现其实不然,至少在Redhat 4上根本不是上面的原因:

[root@localhost RPMS]# rpm -ivh gcc-3.4.6-9.i386.rpm 
warning: gcc-3.4.6-9.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
        glibc-devel >= 2.2.90-12 is needed by gcc-3.4.6-9.i386
    Suggested resolutions:
        /var/spool/up2dateglibc-devel-2.3.4-2.39.i386.rpm
[root@localhost RPMS]# rpm -ivh glibc-devel-2.3.4-2.39.i386.rpm 
warning: glibc-devel-2.3.4-2.39.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
        glibc-headers is needed by glibc-devel-2.3.4-2.39.i386
        glibc-headers = 2.3.4-2.39 is needed by glibc-devel-2.3.4-2.39.i386
    Suggested resolutions:
        /var/spool/up2dateglibc-headers-2.3.4-2.39.i386.rpm
[root@localhost RPMS]# rpm -ivh glibc-headers-2.3.4-2.39.i386.rpm 
warning: glibc-headers-2.3.4-2.39.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
        kernel-headers is needed by glibc-headers-2.3.4-2.39.i386
        kernel-headers >= 2.2.1 is needed by glibc-headers-2.3.4-2.39.i386
    Suggested resolutions:
        /var/spool/up2dateglibc-kernheaders-2.4-9.1.100.EL.i386.rpm
[root@localhost RPMS]# rpm -ivh glibc-kernheaders-2.4-9.1.100.EL.i386.rpm 
warning: glibc-kernheaders-2.4-9.1.100.EL.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:glibc-kernheaders      ########################################### [100%]
[root@localhost RPMS]# rpm -ivh glibc-headers-2.3.4-2.39.i386.rpm 
warning: glibc-headers-2.3.4-2.39.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:glibc-headers          ########################################### [100%]
[root@localhost RPMS]# rpm -ivh glibc-devel-2.3.4-2.39.i386.rpm 
warning: glibc-devel-2.3.4-2.39.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:glibc-devel            ########################################### [100%]
[root@localhost RPMS]# rpm -ivh gcc-3.4.6-9.i386.rpm 
warning: gcc-3.4.6-9.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:gcc                    ########################################### [100%]

看上面的安装记录应该会发现:只要安装上glibc-kernheaders就能继续往下安装了

你可能感兴趣的:(关于在Linux装gcc没有kernel-headers包的问题)