简体   繁体   English

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

[英]Linux - Yum Install GCC - Missing Kernel-headers

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 -->来自更新的 glibc-headers-2.5-58.el5_6.4.x86_64 存在解决问题 --> 缺少依赖项:package 需要内核头 glibc-headers-2.5- 58.el5_6.4.x86_64(更新) glibc-headers来自更新的 -2.5-58.el5_6.4.x86_64 有解决问题 -->

Missing Dependency: kernel-headers >= 2.2.1 is needed by package glibc-headers-2.5- 58.el5_6.4.x86_64 (updates)缺少依赖项:package glibc-headers-2.5-58.el5_6.4.x86_64 需要 kernel-headers >= 2.2.1(更新)

Error: Missing Dependency: kernel-headers >= 2.2.1 is needed by package glibc-headers-2.5-58.el5_6.4.x86_64 (updates)错误:缺少依赖项:package glibc-headers-2.5-58.el5_6.4.x86_64 需要 kernel-headers >= 2.2.1(更新)

Error: Missing Dependency: kernel-headers is needed by package glibc-headers-2.5-58.el5_6.4.x86_64 (updates)错误:缺少依赖项:package 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.没有可用的 package 内核头文件。

Any suggestions?有什么建议么?

Your system is probably configured to exclude the kernel packages.您的系统可能配置为排除 kernel 软件包。

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

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 服务器安装排除的 package,由于本地配置,它仍然会失败。

(This holds for RHEL6 / cent6 (centos6) as well, of course.) (当然,这也适用于 RHEL6 / cent6 (centos6)。)

I ran into this issue trying to install VMWare Tools.我在尝试安装 VMWare Tools 时遇到了这个问题。 It required gcc and kernel headers -> kernel headers were missing.它需要gcckernel 接头-> kernel 接头缺失。

So on Redhat 7.4 I had to execute ' yum install kernel-devel '.所以在 Redhat 7.4 上我不得不执行 ' yum install kernel-devel '。

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

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 上引发上述错误。

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(来自 kernel 开发包)安装到我的自定义 kernel:

sudo yum install kernel-devel-xx.rpm

Then you should be able to run:然后你应该能够运行:

sudo yum install kernel-devel

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM