Monday, July 28, 2014

Downloading the Kernel Source for a different/older kernel than the latest one (RHEL/Fedora/CENTOS)

So I had the unfortunate task of installing a new kernel module that required the kernel source to build (insert sarcastic cheer here lol). When I went to run "./configure" the module kept barking about needing the kernel source. "No problem" I thought, "I'll just head over to the RHEL download site and download the kernel RPM file, rpm -ivh the file and Bob's your uncle right!!!"... wrong, very wrong.  After a bunch of fiddling around I found the solution (assuming your local satellite server/repo still has it).

yum -y --disableexcludes=all install "kernel-devel-$(uname -r)"

[Note: you may not need the --disableexecludes=all, but if your system blacklists such things, then there ya go!] 

~Enjoy!