Last selected entry
To configure grub2 to remember the last selected entry, put these parameters in /etc/default/grub :
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
and save this configuration using the command :
update-grub
Specific entry
If you want to select a specific entry and don't want it to change if a new kernel is installed, you have to use the name of this entry instead of its index number. You took the name in the file /boot/grub/grub.cfg :
menuentry 'Ubuntu, avec Linux 3.2.0-30-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
savedefault
gfxmode $linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 35b16ba3-50a4-4832-bd60-644db6670637
linux /boot/vmlinuz-3.2.0-30-generic root=UUID=35b16ba3-50a4-4832-bd60-644db6670637 ro quiet splash $vt_handoff
initrd /boot/initrd.img-3.2.0-30-generic
}
And use it in the file /etc/default/grub :
GRUB_DEFAULT='Ubuntu, avec Linux 3.2.0-30-generic'
Save configuration with :
update-grub
grub-install -vcommand in terminal. – iKrshnan Feb 9 '12 at 10:50/etc/default/grub, runupdate-grubafter) but setting for the next startup would be useful. – Steven Lu Feb 9 '12 at 17:15