Installing a new kernel
apt-get install kernel-package ncurses-dev module-init-tools initrd-tools procps fakeroot wget bzip2
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.x.x.tar.bz2
bunzip2 linux-2.6.x.x.tar.bz2
tar xvf linux-2.6.x.x.tar
cd linux-2.6.x.x
copy /boot/config-2.6.x.x .config.old Copies an old kernel configuration into the new kernel dir.
make oldconfig Parses the old config options against the new kernel and prompts for unanswered questions
make menuconfig – Load Alternative Config if required
make-kpkg clean
fakeroot make-kpkg –revision=custom.1.0 kernel_image
If compile fails at this point: make clean then rerun make menuconfg to correct.
dpkg -i kernel-image-2.6.x.x_custom.1.0_i386.deb
cd /boot
mkinitrd -o /boot/initrd.img-2.6.x.x 2.6.x.x
Edit /boot/grub/menu.lst and insert the initrd line for the new kernel.
Purging old kernels
dpkg –purge –force-remove-essential kernel-image-2.6.x.x
Listing installed packages
Not as easy as it sounds with kernels as the current dpkg version truncates their names. The following command does the job:
COLUMNS=1000 dpkg -l | awk ‘/kernel-image/ {print $2}’