(GRUB2] sudo grub-mkconfig -o /boot/grub/grub.cfg at each new kernel?

Asked by lann

Hello

When i got a new kernel, i must do this command in the terminal :

sudo grub-mkconfig -o /boot/grub/grub.cfg

if i want to see the entry, when i reboot, of the new kernel in the grub list

Is normal ?

Can i do this automatically ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
lann
Solved:
Last query:
Last reply:
Revision history for this message
Tom (tom6) said :
#1

It doesn't sound very normal. Please get to a command-line
https://help.ubuntu.com/community/UsingTheTerminal#Starting%20a%20Terminal
and type in

cd /boot/grub
ls
sudo cp menu.lst menu.lst-290809
ls
gedit menu.lst

Note the "ls" is a lower-case "LS" and gives a LiSt of what's in the folder. The "sudo" command is only needed because we are trying to do something to a system folder. It will ask for your normal user password, not your Superuser/Root one but does give SuperUser privileges. "cp" should make a CoPy of the "menu.lst" (which is lower-case for "MENU.LST"). I find these quick backup copies much more helpful of they havea date-stamp at the end of the filename, such as "-290809". Hopefully the 2nd "ls" will show the new file "menu.lst-290809".

Gedit is a very basic text-editor. Please copy the whole of "menu.lst" into here for us to try and work out what is going wrong.

Thanks, good luck and regards from
Tom :)

Revision history for this message
lann (lann) said :
#2

Hello Tom

Thank you for reply

I got a problem with this file (/boot/grub/menu.lst) because it doesn't exist.
I am on ubuntu Karmic with grub 2 so i have just /boot/grub/grub.cfg.

Lann

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

Please read https://wiki.ubuntu.com/Grub2

Hope this helps

Revision history for this message
Tom (tom6) said :
#4

Ok, it really is grub2 i thought you were on the grub that is soon to be grub-legacy. Hopefully Marcobra's link should help. I need to learn about grub2 too

Good luck and regards from
Tom :)

Revision history for this message
lann (lann) said :
#5

Hello

I changed the /etc/kernel-img.conf file and added these two lines at the end :

postinst_hook = update-grub
postrm_hook = update-grub

So normally the next it will be ok. Wait and see

Lann

Revision history for this message
lann (lann) said :
#6

Hello

This day, i got a kernel update and automatically a new line was add in the Grub list

So everything is OK

Thanks everybody

Lann

Revision history for this message
Tom (tom6) said :
#7

WooooHooo, nicely fixed, glad it's all working properly there :)))
Congrats and regards from
Tom :)