6

I'm trying to install Virtualbox on Ubuntu 12.10 64bit, (Kernel 3.5.0-23). I've already installed dkms, build-essential, linux-source, linux-kernel-headers, ... . I still get this error:

Error! Your kernel headers for kernel 3.5.0-23-generic cannot be found. Please install the linux-headers-3.5.0-23-generic package, or use the --kernelsourcedir option to tell DKMS where it's located

The kernel headers and source are in their appropriate place:

ls /usr/src
linux-headers-3.5.0-23          linux-source-3.5.0
linux-headers-3.5.0-24          linux-source-3.5.0.tar.bz2
linux-headers-3.5.0-24-generic

I know there are tons of similar questions on different forums, I've tried all of them. None of them works. Can anyone help me please?

parsa
  • 61
  • 1
  • 1
  • 2
  • Have you tried rebooting? 3.5.0-24 was released today and it looks like you have downloaded it but virtualbox thinks you are still running kernel 3.5.0-23. You can also try running 'uname -a' from the command line to find your kernel version. – notkevin Feb 20 '13 at 01:58

2 Answers2

10

Install the kernel headers for your system by running this command in your terminal (Ctrl+Alt+T):

sudo apt-get install linux-headers-$(uname -r)
Eliah Kagan
  • 117,780
theteng
  • 101
2

Install the kernel headers for the running kernel

sudo apt-get install linux-headers-$(uname -r)

Or simply use the linux-headers-generic to install latest release kernel headers.

NOTE: If you have Hardware Enablement Stack (backported) kernels installed on a LTS release, use the linux-headers-current package to install the latest kernel images + headers.

For example, on Ubuntu 12.04, the release kernel is 3.2.0, the linux-current-generic installs 3.8.0-27.

Terry Wang
  • 9,775