Debian Kernel Vesrion 2.6 Compiling

First login to your Debian machine on the command line as root. Install the prerequisites that we need to compile the new kernel:

#apt-get install kernel-package ncurses-dev fakeroot wget bzip2

Then go to /usr/src:

#cd /usr/src

Then get the latest Linux kernel source (or the kernel source you need) from


Unpack the kernel sources:

#tar xjf linux-

#cd linux-

It is normally a good idea to take the configuration of your existing  kernel 2.6 as a starting point for the configuration of your new kernel. Usually the current kernel configuration is saved in a file under /boot, e.g. /boot/config-2.6.12. We will load this configuration and then do the changes we desire

#make menuconfig

Select Load an Alternate Configuration File and enter the location of the configuration file of your current kernel

The configuration of your current kernel will be loaded, and you can now browse through the menu and change the configuration to suit your needs. When you are finished, save your new kernel configuration

Then run the following commands (please note that make dep is not needed any more for kernel 2.6):

#make-kpkg clean
#fakeroot make-kpkg --revision=custom.1.0 kernel_image

If the compilation stops with an error, run

#make clean

and then re-run the previous commands starting with

#make menuconfig

Change the kernel configuration where the error occurs. If no error occurs you will find the new kernel as a Debian package called kernel-image- under /usr/src.

#cd ../

Now you have to install some packages that are needed by kernel 2.6. Add the following line to /etc/apt/sources.list:

deb woody module-init-tools initrd-tools procps

Then run:

#apt-get update
#apt-get install module-init-tools initrd-tools procps

If you are asked the following question:

"If you really want to remove modutils type 'yes':"

type yes.

It might also be necessary to update packages like bind9, quota, etc. - depending on your configuration. If you have problems with your existing packages try to get the appropriate package from

Install your new kernel:

#dpkg -i kernel-image-

Create a ramdisk of your new kernel (otherwise your system will most likely not boot):

#cd /boot/
#mkinitrd -o /boot/initrd.img-

We are almost finished now. Edit the image=/vmlinuz stanza of your /etc/lilo.conf and add the line initrd=/boot/initrd.img-

# Boot up Linux by default.

# restricted
# alias=1



to update your boot loader and reboot your machine:

#shutdown -r now

and if everything is ok your machine should come up with the new kernel. You can run

#uname -a