Question: This morning linux-image-3.5.0-26-generic was installed during a software update. On my laptop this proved to be unusable after 10 minutes. I changed to linux-image-3.5.0-24-generic and all seems fine. I have updated the default grub2 selection to the 24-generic. How can I lock the default grub selection to this value so subsequent updates don't overwrite and make themselves default?

Answer: 
### how to lock a kernel grub entry

With a bit of command line trickery, you can get the default of grub to always be a particular grub entry no matter when a new kernel is installed or updated.

In a terminal type:

```
fgrep menuentry /boot/grub/grub.cfg

```

This will display all your grub entries - for example

![enter image description here](https://i.imgur.com/aBtcj9w.png)

Highlight the entry you want to default to - for example 'Ubuntu, with Linux 3.2.0-31' in the screen-shot. Right click and choose `copy`

Type

```
gksu gedit /etc/default/grub

```

Change the entry

```
GRUB_DEFAULT=0

```

to

```
GRUB_DEFAULT='2>Ubuntu, with Linux 3.2.0-31-generic'

```

i.e. paste the entry you want (including the quotes) BUT PREFIX with the text *2>*

Save, then type

```
sudo update-grub

```

The text *2>* is important because this informs Grub that the entry to boot from exists in the sub-menu called "Previous Linux entries"
you can use this tool, Grub Customizer. To download,
Open terminal and type:

> 
> sudo add-apt-repository ppa:danielrichter2007/grub-customizer [enter]
> 
> 
> sudo apt-get update [enter]
> 
> 
> sudo apt-get install grub-customizer [enter]
> 
> 
> 

Open dash and search grub customizer, and run it. Edit configuration with this tool.it's easy . Go to General Settings to edit the default, time boot etc

![enter image description here](https://i.stack.imgur.com/pH0ux.png)