If you run Debian Squeeze, you could simply add backport repositories to your apt sources if you want to force an upgrade to a new kernel. At the time of writing this, Squeeze is using Linux-image-2.6.32, while Wheezy (testing) and Sid (unstable) are both using Linux-image-3.2. However, on kernel.org, the latest stable release is Linux-image-3.8.2.

One of the few packages that can have multiple versions installed simultaneously, in apt or otherwise on the system, is the Linux kernel. This can be useful, for instance, if you find that your new hardware isn’t supported properly by a slightly old kernel.

Dependencies

Since we’re going to be compiling our own kernel, we need a few things. These are:

  • build-essential
  • module-assistant

Make sure those packages are installed (through apt or aptitude) before continuing. I’m guessing that most of those reading this post will already have the first installed, but perhaps not the second.

Downloading the Kernel Source

Visit kernel.org and decide on a kernel. There probably is a “latest stable release” version that is clearly highlighted, and that’s what I’d recommend. There are also some older, yet still maintained, “longterm” releases of the kernel that may provide updates that suite your needs.

Copy the link. In my case, I’m using the link to the “latest stable” 3.8.2.

Make yourself root, or otherwise superuser, for the rest of this process.

$ sudo -i

Download and unpack the kernel source.

$ cd /usr/src/
$ wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.2.tar.bz2
$ tar -jxf linux-3.8.2.tar.bz2
$ cd linux-3.8.2/

Configuring Old to New

Running the following command will check your current kernel configuration and prompt you when there is a new option available in your new kernel. Most of the time, accepting the preselected values is fine. Sometimes, this is a short process and sometimes it may take a while. If you already know that you want to accept the recommended values, holding the “enter” button down will work just fine and the script will exit back to your working directory.

$ make oldconfig

Build and Install the Kernel

Now, the standard build routine with a module install sandwiched inside.

$ make
$ make modules_install
$ make install
Posted in Linux
Share this post, let the world know

3 Comments

  1. Posted April 16, 2013 at 12:42 | Permalink

    Hi, thank you for your guide. Instead of directly downloading the kernel sources, I used the packages in experimental which include the required Debian patches. Otherwise I did exactly what you indicated.

    The last command added the newer kernel to the GRUB menu, the previous kernel was still there (handy if needed).

    This enabled the Atmel maXTouch Digitizer [03eb:8810] touchscreen on an Asus VivoBook S300CA :) The battery time when full also went from 3.5 hrs to 5.5 hrs.

  2. August
    Posted April 25, 2013 at 16:27 | Permalink

    Thanks for the guide. I’d use make -j [n] if you have a n-core machine.

  3. droideggs
    Posted April 19, 2014 at 16:53 | Permalink

    Thanks for this. I was able to upgrade linux kernel to 3.12.6 using your guide. Just used different kernel version.

    I had to do this because my schiit modi usb audio dac was not supported that came with debian 7 (wheezy, kernel 3.2.0). This fixed the issue.

    Thank you very much

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">