How to install Linux Kernel headers on Debian or Ubuntu

Written by
Date: 2010-12-08 10:50:30 00:00


Since a long time not using it I tried to use VMware again today with my Debian Squeeze, and as the kernel have been upgraded, I had to reconfigure it by running

/usr/bin/vmware-config.pl

What is the location of the directory of C header files that match your running kernel? [/usr/src/Linux/include]

Install C header Linux Kernel on Debian or Ubuntu

To install the Linux Kernel headers on Ubuntu or Debian Linux run this command to install the sources for your kernel specific version.

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

And this command to install the generic package, and keep your sources up to date. Every time you run

sudo apt-get update && sudo apt-get upgrade

Your kernel and kernel headers will upgrade if an upgrade is available.

aptitude install linux-headers-2.6-686
Replace the "-686" for "-(xen vserver openvz)-686" or "-amd64" or "-686-bigmem", if you need to. That depends on your architecture. Use uname -a to check yours.