Ask Your Question

Unable to build kernel modules.

asked 2016-08-16 22:42:53 -0600

Salvation gravatar image

updated 2016-08-18 09:43:41 -0600

florian gravatar image

I'm trying to run a virtual OS with oracle virtualbox. I follow the instructions in the program (after the message pops saying I can't build kernel modules) and get the following:

[root@localhost (username)]# dnf install akmod-VirtualBoxkernel-devel-$(uname -r)
Last metadata expiration check: 1:17:49 ago on Tue Aug 16 21:14:15 2016.
No package akmod-VirtualBoxkernel-devel-4.6.6-300.fc24.x86_64 available.
Error: Unable to find a match.
[root@localhost (username)]# akmods; systemctl restar systemd-modules-load.service
Checking kmods exist for 4.6.6-300.fc24.x86_64             [  OK  ]
Files needed for building modules against kernel
4.6.6-300.fc24.x86_64 could not be found as the following
directories are missing:
/usr/lib/modules/4.6.6-300.fc24.x86_64/build/Is the correct kernel-devel package installed?                                                [FAILED]
Unknown operation restar.

Does anyone know how I can fix this or what I did wrong?

Thank you.

edit retag flag offensive close merge delete



dnf install akmod-VirtualBox you are missing one space here kernel-devel-$(uname -r)

sergiomb gravatar imagesergiomb ( 2016-08-18 15:59:38 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2016-08-17 03:18:53 -0600

jake gravatar image

Couse you entered the command wrong (you missed a space between "uname" and its parameter "-r")

Copy & paste the following:

dnf install akmod-VirtualBoxkernel-devel-$(uname -r)

greets jake

edit flag offensive delete link more



Here is a complete How to install VirtualBox on Fedora 24

I recall a problem with activated "Secure Boot", with this you cannot compile a virtual box kernel module cause it is not propper signed,... never found a solution for that, except turning secure boot off.

jake gravatar imagejake ( 2016-08-17 03:38:55 -0600 )edit

You can sign the kernel module with your own key, then enrol that key for booting. It's a bit of a process, but it works. I've done it.

ssieb gravatar imagessieb ( 2016-08-17 14:55:22 -0600 )edit

@jake, you missed that he corrected the command in the second line, so I don't know why he included the first one...

ssieb gravatar imagessieb ( 2016-08-17 15:01:30 -0600 )edit

answered 2016-08-17 15:01:45 -0600

ssieb gravatar image

If you have the rpmfusion repo enabled, then just do dnf install akmod-VirtualBox.

edit flag offensive delete link more

answered 2016-08-18 14:03:15 -0600

Take the time to read the error, then remedy it.

Error:  Is the correct kernel-devel package installed?


# dnf install kernel-devel

Make sure the currently-running kernel version corresponds to the currently-installed kernel-devel and kernel-headers packages.

edit flag offensive delete link more

Question Tools


Asked: 2016-08-16 22:42:53 -0600

Seen: 1,479 times

Last updated: Aug 18 '16