原文:http://apps.hi.baidu.com/share/detail/45946626
安装 gcc之前google了一下,发现这是个麻烦事,心里也做好了准备,花费了一下午终于搞定,
事先确定要安装符合rhel4的rpm,由此找到下面这个网址:
里面很全,基本涵盖了安装gcc所需的所有其他rpm
1)安装gcc
rpm -ivh gcc-3.3.2-6.i386.rpm
warning: gcc-3.4.6-9.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
error: Failed dependencies:
binutils >= 2.15.92.0.2-18 is needed by gcc-3.4.6-9.i386
cpp = 3.4.6-9 is needed by gcc-3.4.6-9.i386
glibc-devel >= 2.2.90-12 is needed by gcc-3.4.6-9.i386
libgcc >= 3.4.6-9 is needed by gcc-3.4.6-9.i386
Suggested resolutions:
glibc-devel-2.3.4-2.9.i386.rpm
失败
根据错误信息--〉1-1,1-2,1-3,1-4
1-1)更新binutils
rpm -Uvh binutils-2.15.92.0.2-24.i386.rpm
1-2)更新cpp
rpm -Uvh cpp-3.4.6-9.i386.rpm
1-3)更新libgcc
rpm -Uvh libgcc-3.4.6-9.i386.rpm
1-4)更新glibc-devel
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 443e1821
error: Failed dependencies:
glibc = 2.3.4-2.39 is needed by glibc-devel-2.3.4-2.39.i386
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:
glibc-headers-2.3.4-2.9.i386.rpm
根据错误信息---〉1-4-1,1-4-2
1-4-1)更新glibc
warning: glibc-2.3.4-2.39.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
error: Failed dependencies:
glibc-common = 2.3.4-2.39 is needed by glibc-2.3.4-2.39.i386
根据错误信息--〉1-4-1-1
1-4-1-1)
rpm -Uvh glibc-common-2.3.4-2.39.i386.rpm
warning: glibc-common-2.3.4-2.39.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
error: Failed dependencies:
glibc-common = 2.3.4-2.9 is needed by (installed) glibc-2.3.4-2.9.i686
又出错,强行更新,反正这个也不会用,以及依赖它的rpm也要跟新
rpm -Uvh glibc-common-2.3.4-2.39.i386.rpm --nodeps --force
返回到1-4-1)
rpm -Uvh glibc-2.3.4-2.39.i386.rpm
1-4-2)安装glibc-headers
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 443e1821
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:
glibc-kernheaders-2.4-9.1.87.i386.rpm
根据出错信息---〉1-4-2-1
1-4-2-1)安装glibc-kernheaders
rpm -ivh glibc-kernheaders-2.4-9.1.100.EL.i386.rpm
返回1-4-2 )
rpm -ivh glibc-headers-2.3.4-2.39.i386.rpm
返回1-4)
rpm -ivh glibc-devel-2.3.4-2.39.i386.rpm
返回1)
rpm -ivh gcc-3.4.6-9.i386.rpm
安装完成,gcc -v
显示信息
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)