如何在没有Internet连接的情况下为GCC安装C编译器? (RHEL6) [英] How to install C compiler for GCC without Internet connection? (RHEL6)
问题描述
我试图在RHEL6虚拟机上从源代码构建GCC,并且遇到了Catch 22.也就是说,我需要一个C编译器才能成功配置。解决方案似乎很简单 - 执行yum来解决依赖关系。但是,这个虚拟机不能连接互联网。
任何人都有包含预编译编译器的二进制文件或.rpm的源代码,从而简化安装过程?我搜索了,但找不到一个。或者,是否存在RHEL6命令来安装预编译的GCC版本?如果两者都不可行,我可以采用哪些C编译器来解决这个问题?
对于上下文,这里是我收到的消息:
../ gcc-4.7.2 / configure
检查编译系统类型... x86_64-unknown-linux-gnu
检查主机系统类型。 .. x86_64-unknown-linux-gnu
检查目标系统类型... x86_64-unknown-linux-gnu
检查BSD兼容安装... / usr / bin / install -c
检查ln是否工作...是
检查ln -s是否工作...是
检查不截断输出的sed ... / bin / sed
检查为gawk ... gawk
检查libitm支持...是
检查gcc ...不
检查cc ...不
检查cl.exe。 .. no
configure:error:in`/ gcc / gcc-build':
configure:error:在$ PATH中找不到可接受的C编译器
查看`config.log'以获取更多详细信息。
无法编译gcc源代码C编译器安装在您的VM上。
如果您可以将文件从您的主机转换为VM,那么您有两种方法:
-
编译主机上的源代码并将其复制到您的虚拟机。使用
./ configure --prefix = /< path> /< to> /< output>
来指定输出目录。如果您的虚拟机CPU的arch与主机不同,您可能需要查看交叉编译。 从Redhat的rpm存储库镜像下载gcc rpm软件包。搜索它在谷歌,你会得到一个答案。
但总是一个好主意,使用 yum
或 rpm
在RHEL中安装软件。我对你的问题有一些疑问:
- 为什么你的RHEL6没有安装gcc?它是默认安装的。
- 您使用的是什么虚拟机?您的问题的最佳解决方案可能是找出在虚拟机中使用网络的方法。
I'm attempting to build GCC from source on a RHEL6 virtual machine, and have run into a Catch 22. That is, I need a C compiler for successful configuration. The solution seems simple enough - execute yum to solve dependencies. However, this virtual machine cannot have an Internet connection.
Does anybody have any sources for a binary or .rpm containing a pre-compiled compiler, simplifying installation? I've searched, but cannot find one. Alternatively, does a RHEL6 command exist to install a pre-compiled version of GCC? If neither are possible, what C compilers might I pursue to resolve this?
For context, here's the message I receive:
../gcc-4.7.2/configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for libitm support... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/gcc/gcc-build':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
It is not possible to compile gcc source code without any C compiler installed on your VM.
If you can transform files from your host to VM, then you have two ways:
Compile the source code on your host and copy them to your VM. Use
./configure --prefix=/<path>/<to>/<output>
to specify the output directory. If your VM CPU arch is different from your host, you may want to look at cross compile.Download gcc rpm package from a Redhat's rpm repository mirror. Search it in google and you will get an answer.
But it is always a good idea to use yum
or rpm
to install software in RHEL. I have some questions about your problem:
- Why you don't have gcc installed on your RHEL6? It is installed by default.
- What VM are you using? The best solution of your problem may be figuring out a way to get network available in your VM.
这篇关于如何在没有Internet连接的情况下为GCC安装C编译器? (RHEL6)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!