Linux - Yum Install GCC - Missing Kernel-headers

93,398

Solution 1

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:

yum install kernel-headers --disableexcludes=all

Solution 2

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

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.

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

Solution 3

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

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

Solution 4

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
Share:
93,398
Stewart Dick
Author by

Stewart Dick

Updated on June 13, 2020

Comments

  • Stewart Dick
    Stewart Dick almost 4 years

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

    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)


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

    No package kernel-headers available.

    Any suggestions?

  • Stewart Dick
    Stewart Dick almost 13 years
    That Returns Warning: No matches found for: kernel-headers No Matches found
  • Guerry
    Guerry over 12 years
    If the problem was the yum.conf file as you indicated in a follow-on comment, why did you mark this answer as correct instead of xgMz's answer below?
  • Guerry
    Guerry over 12 years
    This pointed to the real problem for me. IT team excluded the kernel-headers to prevent automatic kernel updates in part of their roll out process.
  • phatblat
    phatblat over 12 years
    I'm voting this answer up since it put me on the right track. A comment in /etc/yum.conf referenced repo definition files and in one of those (/etc/yum.repos.d/reponame.repo) I found this exclusion. Thanks
  • runako
    runako over 11 years
    I found the offending references in some files in /etc/yum.repos.d/ .
  • Warren Young
    Warren Young over 10 years
    +1: This is a better answer than editing yum.conf when you are installing a single package to fit a dependency, and want the previous exclusion rules to continue to apply for future yum commands. This is common on paravirtualized environments where kernel updates are disabled because that would break the system, since it is using a special kernel. Temporarily disabling this exclusion to get kernel-headers to satisfy the gcc dependency is harmless.
  • khanna
    khanna over 4 years
    Thanks xgMz, just in case, FWIW, it helps to check this in as a deployment strategy / ansible task - do "sed -i 's/exclude/#exclude/g' /etc/yum.conf" nevertheless all credit xgMz saviour!