Install kernel headers

From MEPIS Documentation Wiki

Jump to: navigation, search

In order to compile some programs you might need to have kernel headers (C files that define structures and constants that are needed for building most standard programs present). Some programs ask for kernel sources, but most likely the headers are sufficient.

There are 2 ways to accomplish this task, both work equally well, though the first is by far the easiest.

This is the first method

  1. open Konsole
  2. type su and then root password when prompted, and then type (or highlight the text below and drag it to the konsole window):
apt-get update && m-a prepare

This will first update your apt package cache, then query your system and install the correct kernel headers and supporting files. Usually, this is sufficient and requires no further setup or tweaks, though for best results, we recommend your system is running the most recent kernel version available from the MEPIS repositories for your installed system before you start.


If you prefer a more hands-on approach, this second method may be more to your liking

  1. open Konsole
  2. type su and then root password when prompted, and then type (or highlight the text below and drag it to the konsole window):
apt-get install linux-headers-$(uname -r)

This code will enter automatically the number of your working kernel and fetch the appropriate headers.

You might need to execute the following command to create a symlink to the kernel headers (explanation: some programs look in /usr/src/linux for kernel headers, this command links /usr/src/linux to the actually directory where the headers are):

ln -sf /usr/src/linux-headers-$(uname -r) /usr/src/linux
Personal tools
In other languages