yum installs kernel-devel different from my kernel version

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> ?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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.

Method 2

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)

Method 3

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.

Method 4

I come across the same thing after update the kernel and Jim’s answer helped a lot.
To do enable the [elrepo-kerne] repo, go to /etc/yum.repos.d/elrepo.repo file and set enabled=1 (rather than enabled=0) for [elrepo-kernel], then do the update informed by slm’s answer.
After that, reverse to the enabled=0, so that the yum will not interact with this repo.
Just to point out, the command yum repolist all will show you all enabled and disabled repos.

Method 5

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.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x