Linux - Yum Install GCC - Missing Kernel-headers

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

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.)


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'.