Linux - How do I tell if I have my kernel sources installed?

Updated 02/25/2008 10:48 AM

How do I tell if I have my kernel sources installed?


If you are running on a distro that uses RPM (Red Hat, Mandrake, SuSE,
etc), then you can use RPM to tell you.  At a shell prompt, type:

 `rpm -qa | grep kernel`

and look at the output.  You should see a package that corresponds
to your kernel (often named something like kernel-2.4.18-3)
and a kernel source package with the same version (often named
something like kernel-source-2.4.18-3).  If none of the lines seem
to correspond to a source package, then you will probably need to
install it.  If the versions listed mismatch (ex: kernel-2.4.18-10 vs.
kernel-source-2.4.18-3), then you will need to update the kernel-source
package to match the installed kernel.  If you have multiple kernels
installed, you need to install the kernel-source package that
corresponds to your *running* kernel (or make sure your installed
source package matches the running kernel).  You can do this by
looking at the output of 'uname -r' and matching versions.

Is this answer helpful?

Live Chat

Chat online with one of our support agents

CHAT NOW

ASK US A QUESTION

Contact Support for assistance

Click here