Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1511  / 2 Years ago, wed, march 9, 2022, 4:07:19

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?


More From » grub2

 Answers
7

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


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"


[#32431] Friday, March 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionavocad

Total Points: 189
Total Questions: 101
Total Answers: 118

Location: Liechtenstein
Member since Wed, Dec 8, 2021
2 Years ago
tionavocad questions
Tue, May 23, 23, 00:07, 1 Year ago
Tue, Jan 17, 23, 20:38, 1 Year ago
Sun, Oct 10, 21, 04:50, 3 Years ago
Tue, Jun 7, 22, 08:50, 2 Years ago
;