Tuesday, 22 November 2011

How to Recompile your Kubuntu 11.10 Kernel

This quick and simple guide will help you to recompile your Kubuntu 11.10 Kernel. Modify where appropriate, eg amd64 / i386.

1. Install these packages

sudo apt-get install fakeroot dpkg-dev libncurses5-dev kernel-package

2. Create your source directory

mkdir ~/src

cd ~/src

3. Download the Kernel source

apt-get source linux-image-$(uname -r)

4. Configure your Kernel

cd linux-3.0.0

make menuconfig

5. Speed up the build


General rule, concurrency level = number of processor cores + 1

6. Clean up temp files from a previous compile attempt (skip if necessary)

make-kpkg clean

7 Compile your Kernel

time fakeroot make-kpkg --initrd --append-to-version=-tweak kernel-image kernel-headers

You can change -tweak to anything you wish

8. Install your Kernel

cd ~/src

sudo dpkg -i linux-image-3.0.6-tweak_3.0.6-tweak-10.00.Custom_amd64.deb

sudo dpkg -i linux-headers-3.0.6-tweak_3.0.6-tweak-10.00.Custom_amd64.deb

9. Reboot

Your recompiled Kernel should automatically load.