Centos – Empty kernel directory but kernel-headers are installed

centoskernel

Host – Windows 7

Guest – CentOS

I am trying to install kernel-headers using yum since during the installation of vmware-tools I get a message asking for the path to the kernel header files for the 3.10.0-229.7.2.e17.x86_64.

Running yum install kernel-headers returns Package kernel-headers-3.10.0-229.7.2.e17.x86_64 already installed and latest version. But the directory /usr/src/kernels is empty.

Are the kernel headers installed somewhere else? Or should I be asking yum to install something else?

Path provided to vmware-tools for kernel headers

Searching for a valid kernel header path...
The path "" is not a valid path to the 3.10.0-229.7.2.e17.x86_64 kernel headers.
Would you like to change it? [yes]

Providing the path /usr/include/linux gives the same response again but with "" replaced with the path provided.

Best Answer

The correct package to install all of the required dependencies for building kernel modules is kernel-devel (see the CentOS documentation for more information).

The headers are not installed in /usr/src/kernels, rather they're installed in a number of directories below /usr/include (the default location for C header files). You can list the contents of the kernel-headers package you installed using:

rpm -ql kernel-headers
Related Question