RedHat9下安装gcc时可能遇到的问题及解决

相信现在还有不少人在用经典的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

apt-get install gcc

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wzwzfx.html