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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content