Linux - Yum 安装 GCC - 缺少内核头文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6513731/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 04:49:07  来源:igfitidea点击:

Linux - Yum Install GCC - Missing Kernel-headers

linuxgccyumcentos5centos6

提问by Stewart Dick

When ever i try to install GCC on my linux (centos) It comes back with missing

当我尝试在我的 linux (centos) 上安装 GCC 时,它会丢失

glibc-headers-2.5-58.el5_6.4.x86_64 from updates has depsolving problems --> Missing Dependency: kernel-headers is needed by package glibc-headers-2.5- 58.el5_6.4.x86_64 (updates) glibc-headers-2.5-58.el5_6.4.x86_64 from updates has depsolving problems -->

Missing Dependency: kernel-headers >= 2.2.1 is needed by package glibc-headers-2.5- 58.el5_6.4.x86_64 (updates)

Error: Missing Dependency: kernel-headers >= 2.2.1 is needed by package glibc-headers-2.5-58.el5_6.4.x86_64 (updates)

Error: Missing Dependency: kernel-headers is needed by package glibc-headers-2.5-58.el5_6.4.x86_64 (updates)

来自更新的 glibc-headers-2.5-58.el5_6.4.x86_64 有 depsolving 问题 --> Missing Dependency: kernel-headers is required by package glibc-headers-2.5- 58.el5_6.4.x86_64 (updates) glibc-headers -2.5-58.el5_6.4.x86_64 来自更新有解决问题 -->

缺少依赖项:包 glibc-headers-2.5-58.el5_6.4.x86_64(更新)需要 kernel-headers >= 2.2.1

错误:缺少依赖项:包 glibc-headers-2.5-58.el5_6.4.x86_64(更新)需要 kernel-headers >= 2.2.1

错误:缺少依赖项:glibc-headers-2.5-58.el5_6.4.x86_64 包需要内核头文件(更新)



I try yum install kernel-header & kernel-devel but get back:

我尝试 yum install kernel-header & kernel-devel 但又回来了:

No package kernel-headers available.

没有可用的包内核头文件。

Any suggestions?

有什么建议?

采纳答案by xgMz

Your system is probably configured to exclude the kernel packages.

您的系统可能配置为排除内核包。

try:

尝试:

sudo vi /etc/yum.conf

then comment (or remove the 'kernel*' part):

然后评论(或删除“内核*”部分):

#exclude=kernel*

Then you should be able to do:

那么你应该能够做到:

sudo yum install kernel-headers

Edit: Or, as pointed by Andrew Beals, you can simply run:

编辑:或者,正如Andrew Beals所指出的,您可以简单地运行:

yum install kernel-headers --disableexcludes=all

回答by Will

try

尝试

yum search kernel-headers

gives:

给出:

arm-gp2x-linux-kernel-headers.noarch : Kernel headers for Cross Compiling to
                                     : arm-gp2x-linux
kernel-headers.x86_64 : Header files for the Linux kernel for use by glibc

回答by Andrew Beals

Yes, you could edit the yum.conf file, or you could simply do this:

是的,您可以编辑 yum.conf 文件,或者您可以简单地执行以下操作:

yum install kernel-headers --disableexcludes=all

Do note that even if your admin is trying to install an excluded package from your RHN Satellite server via the normal process, it will still fail due to the local configuration.

请注意,即使您的管理员尝试通过正常过程从您的 RHN Satellite 服务器安装排除的软件包,由于本地配置,它仍然会失败。

(This holds for RHEL6 / cent6 (centos6) as well, of course.)

(当然,这也适用于 RHEL6 / cent6 (centos6)。)

回答by Dylan Kapp

I ran into this issue trying to install VMWare Tools. It required gccand kernel headers-> kernel headers were missing.

我在尝试安装 VMWare 工具时遇到了这个问题。它需要gcc内核头文件-> 缺少内核头文件。

So on Redhat 7.4 I had to execute 'yum install kernel-devel'.

所以在 Redhat 7.4 上我必须执行 ' yum install kernel-devel'。

回答by Dave Hazelden

If you installed from Cloudlinux ISO, you can't do anything until you activate your server against a license, it will throw above error on a VPS.

如果您是从 Cloudlinux ISO 安装的,那么在您根据许可证激活服务器之前,您不能做任何事情,它会在 VPS 上引发上述错误。

回答by Lina Maudlej

I had the same issue. It seems that I need to install the kernel-devel-xx.rpm (from kernel development package) to my custom kernel:

我遇到过同样的问题。看来我需要将 kernel-devel-xx.rpm(来自内核开发包)安装到我的自定义内核中:

sudo yum install kernel-devel-xx.rpm

Then you should be able to run:

然后你应该能够运行:

sudo yum install kernel-devel