31

I am attempting to install the VMWare player in Fedora 19. I am running into the problem that multiple users have had where VMware player cannot find the kernel headers. I have installed the kernel-headers and kernel-devel packages through yum and the file that appears in /usr/src/kernels is:

3.12.8-200.fc19.x86_64

However, when I do uname -r my Fedora kernel version is:

3.9.5-301.fc19.x86_64

which is a different version. This seems to mean that when I point VMware player at the path of the kernels I get this error:

C header files matching your running kernel were not found.  
Refer to your distribution's documentation for installation instructions.

How can I install the correct Kernel and where should I be pointing VMware if its not /usr/src/kernels/<my-kernel> ?

  • Just curious ... Why aren't you running the latest kernel in Fedora 19? – rickhg12hs Jan 24 '14 at 18:25
  • Not by a my own decision. I installed from the webiste the latest build that i could. Is there a way to update the kernel? – Fantastic Mr Fox Jan 28 '14 at 1:46
  • Most keep all the packages current by using the Package Manager or as root executing yum update from a command line. Done frequently, and with a decent Internet connection, it doesn't take long, but you've got a bit of catch-up to do. To use the new kernel, you'll need to reboot after the update is done. – rickhg12hs Jan 28 '14 at 10:38
32

You can install the correct kernel header files like so:

$ sudo yum install "kernel-devel-uname-r == $(uname -r)"

Example

This command will always install the right version.

$ sudo yum install "kernel-devel-uname-r == $(uname -r)"
Loaded plugins: auto-update-debuginfo, changelog, langpacks, refresh-packagekit
No package kernel-devel-uname-r == 3.12.6-200.fc19.x86_64 available.
Error: Nothing to do

Or you can search for them like this:

$ yum search "kernel-headers-uname-r == $(uname -r)" --disableexcludes=all
Loaded plugins: auto-update-debuginfo, changelog, langpacks, refresh-packagekit
Warning: No matches found for: kernel-headers-uname-r == 3.12.6-200.fc19.x86_64
No matches found

However I've notice this issue as well where specific versions of headers are not present in the repositories. You might have to reach into Koji to find a particular version of a build.

That page includes all the assets for that particular version of the Kernel.

  • 2
    Why is this better than yum install "kernel-devel-$(uname -r)"? From your example, it doesn't even seem to even work... – drs Jan 28 '14 at 15:28
  • 1
    @drs - It doesn't work b/c there aren't any matching pkgs that provide the headers for my kernel version. Using the for -uname-r` is a more portable way of doing work w/ pkgs that are tied to the kernel version. It's used on most repos if you look at their examples too: rpmfusion.org/Howto/nVidia – slm Jan 28 '14 at 17:56
  • This was really helpful. I thought i had installed the correct version of kernel headers, a very small difference in name, but it was not correct and failing to build. Above command helped me got the actual one as well as give me better insight into package search. Thank you +1 – fayyazkl Apr 24 '14 at 23:07
  • Is there a way we can make yum/dnf automatically install new kernel headers as well whenever it updates the kernel ? – Shankar Narayanan Dec 31 '15 at 2:37
  • 2
    @slm where can I find any information/documentation on this syntax: "kernel-devel-uname-r == $(uname -r)"? – Vadim Kotov Oct 31 '17 at 15:52
8

Distribution Synchronization

Your problem could be "distribution synchronization". Running this command solved my problem.

yum distro-sync

Synchronizes the installed package set with the latest packages available, this is done by either obsoleting, upgrading or downgrading as appropriate. (http://man7.org/linux/man-pages/man8/yum.8.html)

4

You can install a specific version of a package by specifying the version along with the package name with yum. For example, to install the kernel development files for the specific kernel you're running, type

yum install kernel-devel-3.9.5-301.fc19

You can do a similar command to get the right kernel-headers package.

0

It happens some times also to me, installing VMBoxAdditions after a system update.

I have to remove kernel-devs:

yum remove kernel-devel

and then re-install it:

yum install kernel-devel

And then magically it works.

-2

After following everyones suggestions I found one thing on my end that helped fix this. I had to enable the [elrepo-kernel] repo. Then I was able to install the correct headers and kernel-devel

  • This is not a complete answer to the question. You should either improve your answer with more details, or add this as a comment. – Fantastic Mr Fox Jun 6 at 7:15
  • @FantasticMrFox This is an answer to the question, albeit a short answer without explanation as to why this procedure is necessary, and it duplicates what others have already said. – Kusalananda Jun 6 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.