Error "Your kernel headers for kernel cannot be found at /lib/modules/kernel-version/build or /lib/modules/kernel-version/source" When trying to build kernel modules

Solution Verified - Updated -

Issue

When trying to build kernel modules encountered the following errors:

Error! Your kernel headers for kernel 2.6.18-238.5.1.el5 cannot be found at
/lib/modules/2.6.18-238.5.1.el5/build or /lib/modules/2.6.18-238.5.1.el5/source. [FAILED]
  • How do I install missing kernel headers or kernel source? Are there more missing?

Environment

  • Red Hat Enterprise Linux all versions

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.