安装redhat6没有gcc
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装redhat6没有gcc相关的知识,希望对你有一定的参考价值。
参考技术A 如果在安装Red Hat 6之后发现没有gcc编译器,可以按照以下步骤安装它:确认已安装必要的软件包:在安装gcc之前,需要确保已安装了一些必要的软件包,例如make、glibc、kernel-headers等。你可以使用以下命令检查这些软件包是否已安装:
plaintext
Copy code
rpm -qa | grep make
rpm -qa | grep glibc
rpm -qa | grep kernel-headers
如果有软件包未安装,可以使用以下命令安装这些软件包:
plaintext
Copy code
yum install make glibc kernel-headers
安装gcc编译器:安装gcc编译器的最简单方法是使用yum包管理器。你可以使用以下命令安装gcc编译器和其他相关软件包:
plaintext
Copy code
yum groupinstall "Development Tools"
这将安装gcc编译器及其依赖项。
3. 验证gcc是否安装成功:安装完成后,可以使用以下命令验证gcc是否已成功安装:
plaintext
Copy code
gcc --version
如果gcc已成功安装,将显示gcc的版本信息。
请注意,如果你的Red Hat 6系统未连接到互联网,可能无法使用yum包管理器。在这种情况下,你需要手动下载所需软件包并进行安装。你可以从Red Hat官方网站下载相应的软件包,例如gcc、make、glibc、kernel-headers等。
redhat9安装gcc(转)
原文链接:http://blog.chinaunix.net/uid-20260767-id-118036.html
第一种方法:
相信现在还有不少人在用经典的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
在安装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 第一张光盘中查找以上三个软件包,并安装它们。
[[email protected] mnt]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[[email protected] mnt]# find -iname binutils*
./cdrom/RedHat/RPMS/binutils-2.13.90.0.18-9.i386.rpm
[[email protected] 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%]
[[email protected] mnt]# find -iname cpp*
./cdrom/RedHat/RPMS/cpp-3.2.2-5.i386.rpm
[[email protected] 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%]
[[email protected] mnt]# find -iname glibc-devel*
./cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
[[email protected] 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
mount: block device /dev/cdrom is write-protected, mounting read-only
[[email protected] mnt]# find -iname binutils*
./cdrom/RedHat/RPMS/binutils-2.13.90.0.18-9.i386.rpm
[[email protected] 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%]
[[email protected] mnt]# find -iname cpp*
./cdrom/RedHat/RPMS/cpp-3.2.2-5.i386.rpm
[[email protected] 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%]
[[email protected] mnt]# find -iname glibc-devel*
./cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
[[email protected] 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,看下面:
[[email protected] mnt]# find -iname glibc-k*
./cdrom/RedHat/RPMS/glibc-kernheaders-2.4-8.10.i386.rpm
[[email protected] 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%]
[[email protected] mnt]# find -iname glibc-devel*
./cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
[[email protected] 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%]
./cdrom/RedHat/RPMS/glibc-kernheaders-2.4-8.10.i386.rpm
[[email protected] 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%]
[[email protected] mnt]# find -iname glibc-devel*
./cdrom/RedHat/RPMS/glibc-devel-2.3.2-11.9.i386.rpm
[[email protected] 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:
[[email protected] mnt]# umount /mnt/cdrom
[[email protected] mnt]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[[email protected] 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
[[email protected] 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%]
[[email protected] mnt]#
[[email protected] mnt]# mount /dev/cdrom /mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[[email protected] 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
[[email protected] 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%]
[[email protected] mnt]#
现在查看一下gcc有没有装好:
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 gcc
以上是关于安装redhat6没有gcc的主要内容,如果未能解决你的问题,请参考以下文章
vmware安装Linux(redhat6.5),iso镜像挂载