Sunday, September 19, 2010

Changing Default Kernels in Linux

A quick post (partly to keep this information handy in the future for myself):

How to change the default starting kernel in Linux (Ubuntu 10.04 to be specific, but these directions should work for other distros):

If GRUB1 is your bootloader:

sudo nano /boot/grub/menu.lst
Change default 0 to the number of the kernel you want to start automatically (list of available kernels at the bottom of the page, just below END DEFAULT OPTIONS)

If GRUB2 is your bootloader (default in 9.10 and later I believe):

nano /boot/grub/grub.cfg (look at the bottom of this file for the kernel you want and count which one it is (0 is the first, 1 is the second, etc)
sudo nano /etc/default/grub
If you want to have a menu display during bootup, comment out GRUB_HIDDEN_TIMEOUT=0. To change your default kernel, put the number in GRUB_DEFAULT. You can also use the full name which was visible in the /boot/grub/grub.cfg file, such as GRUB_DEFAULT="Ubuntu, with Linux 2.6.31-11-rt"

Well that's it for now. Have fun with custom kernels!