原文連接:http://blog.chinaunix.net/uid-20260767-id-118036.htmlhtml
第一種方法:
相信如今還有很多人在用經典的RedHat9,畢竟他是徹底免費的紅帽Linux嘛!
如今介紹一下在安裝gcc時可能遇到的問題。
在安裝gcc時,可能會提示要求安裝下面幾個軟件包:
binutils-2.13.90.0.18-9.i386.rpm
cpp-3.2.2-5.i386.rpm
glibc-devel-2.3.2-11.9.i386.rpm
別擔憂,一步一步來。首先在red hat 第一張光盤中查找以上三個軟件包,並安裝它們。
[root@RedHat9 mnt]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@RedHat9 mnt]# find -iname binutils*
./cdrom/RedHat/RPMS/binutils-2.13.90.0.18-9.i386.rpm
[root@RedHat9 mnt]# rpm -ivh cdrom/RedHat/RPMS/binutils-2.13.90.0.18-9.i386.rpm
warning: cdrom/RedHat/RPMS/binutils-2.13.90.0.18-9.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:binutils ########################################### [100%]
[root@RedHat9 mnt]# find -iname cpp*
./cdrom/RedHat/RPMS/cpp-3.2.2-5.i386.rpm
[root@RedHat9 mnt]# rpm -ivh cdrom/RedHat/RPMS/cpp-3.2.2-5.i386.rpm
warning: cdrom/RedHat/RPMS/cpp-3.2.2-5.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:cpp ########################################### [100%]
[root@RedHat9 mnt]# find -iname glibc-devel*
./cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
[root@RedHat9 mnt]# rpm -ivh cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
warning: cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
error: Failed dependencies:
kernel-headers is needed by glibc-devel-2.3.2-11.9
kernel-headers >;= 2.2.1 is needed by glibc-devel-2.3.2-11.9
這時不要查找kernel-headers,放心,你在三張光盤中都找不到kernel-headers的。你要查找glibc-kernheaders,看下面:
[root@RedHat9 mnt]# find -iname glibc-k*
./cdrom/RedHat/RPMS/glibc-kernheaders-2.4-8.10.i386.rpm
[root@RedHat9 mnt]# rpm -ivh cdrom/RedHat/RPMS/glibc-kernheaders-2.4-8.10.i386.rpm
warning: cdrom/RedHat/RPMS/glibc-kernheaders-2.4-8.10.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:glibc-kernheaders ########################################### [100%]
[root@RedHat9 mnt]# find -iname glibc-devel*
./cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
[root@RedHat9 mnt]# rpm -ivh cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
warning: cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:glibc-devel ########################################### [100%]
到此爲止,gcc所依賴的軟件包都安裝了,如今插入第二張光盤,安裝gcc:
[root@RedHat9 mnt]# umount /mnt/cdrom
[root@RedHat9 mnt]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@RedHat9 mnt]# find -iname gcc*
./cdrom/RedHat/RPMS/gcc-3.2.2-5.i386.rpm
./cdrom/RedHat/RPMS/gcc-c++-3.2.2-5.i386.rpm
./cdrom/RedHat/RPMS/gcc-g77-3.2.2-5.i386.rpm
./cdrom/RedHat/RPMS/gcc-gnat-3.2.2-5.i386.rpm
./cdrom/RedHat/RPMS/gcc-java-3.2.2-5.i386.rpm
./cdrom/RedHat/RPMS/gcc-objc-3.2.2-5.i386.rpm
[root@RedHat9 mnt]# rpm -ivh cdrom/RedHat/RPMS/gcc-3.2.2-5.i386.rpm
warning: cdrom/RedHat/RPMS/gcc-3.2.2-5.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:gcc ########################################### [100%]
[root@RedHat9 mnt]#
如今查看一下gcc有沒有裝好:
[root@RedHat9 mnt]# rpm -qa gcc*
gcc-3.2.2-5
[root@RedHat9 mnt]#
gcc終於安裝成功啦!:)
第二種方法:(我沒測試 呵呵)
wget http://download.fedora.us/fedora/redhat/9/i386/RPMS.stable/apt-0.5.5cnc6-0.fdr.8.rh90.i386.rpm
rpm -i apt*.rpm
apt-get update
apt-get install gccjava