LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-08-2019, 05:41 PM   #1
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Rep: Reputation: Disabled
Question How is grub updated after kernel installation


Hello,

I install new kernel using debian packages, with command:

Code:
udo dpkg -i linux-*version*.deb
Now, I see right after this the next time I boot into my ubuntu 18.04 OS, new kernel was selected. However, I see no records in
Quote:
/etc/default/grub
There are entries for new kernel in:
Quote:
/boot/grub/grub/grub.cfg
However this file was autogenerated so modifying it makes no sense.

So, here is my question. How can I manually edit grub settings to boot kernel of choice?
 
Old 05-08-2019, 06:06 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
post the contents of your
Code:
/etc/default/grub
file. that file is for editing, the grub.cfg is not.

when a new kernel is installed, (during update) it is usually followed by hook to update your cfg file automatically.

GNU GRUB Manual 2.02

Last edited by BW-userx; 05-08-2019 at 06:13 PM.
 
Old 05-10-2019, 04:30 PM   #3
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
Thanks for the answer,

There are no words to express how GRUB annoys me

I try to setup default grub, I even found similar problem here

https://superuser.com/questions/2085...ernel-to-grub2

So what I do is I set GRUB_DEFAULT in /etc/default/grub to kernel name - FAIL, still boots the exact same kernel #0 from list. Then I didn't give up and try setting GRUB_DEFAULT to number/index regarding to menuentry in /boot/grub/grub.cfg - no luck again.

Here is content of my /etc/default/grub

Quote:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=4
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
Does anybody know why this crap doesn't boot the kernal I specify by GRUB_DEFAULT?

PS: of cource I do sudo grub-update after I change that /etc/default/grub file

Last edited by mra90; 05-10-2019 at 04:32 PM.
 
Old 05-10-2019, 04:52 PM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
count from zero, so if it is the fourth menu entry then it would be 3
 
Old 05-10-2019, 05:03 PM   #5
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
@colorpurple21859 , good catch but it still not the problem since it boots #0 as I said ;/
 
Old 05-10-2019, 06:05 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
did you run
Code:
sudo update-grub
after making changes to /etc/default/grub?
 
Old 05-10-2019, 06:10 PM   #7
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
did you run
Code:
sudo update-grub
after making changes to /etc/default/grub? could also try grub_save default https://www.maketecheasier.com/set-g...ast-selection/
 
Old 05-10-2019, 06:39 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
I cannot agree more, default is only on installed OS'e including Windows and other than Linux, it is zero based, every time you make changes to your /etc/default/grub file you have to update grub in order for the changes to take place.
 
Old 05-10-2019, 07:51 PM   #9
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
Guys you missed my "PS" section
Quote:
PS: of cource I do sudo grub-update after I change that /etc/default/grub file
Of course I updated grub
 
Old 05-10-2019, 08:10 PM   #10
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
If this is the only os on the system try disabling os-prober with this entry to your /etc/default/grub:
GRUB_DISABLE_OS_PROBER=true
 
Old 05-10-2019, 08:32 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
and put the other back to zero (0)
 
Old 05-11-2019, 05:20 AM   #12
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
@colorpurple21859, I have added you suggestion "GRUB_DISABLE_OS_PROBER=true" but still grub boots the very first kernel from /boot/grub/grub.cfg

Below content of /etc/default/grub I have now:

Quote:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT="gnulinux-4.9.45-upboard+-advanced-d5007568-bf96-4bc4-9723-a0d06b750cb4"
GRUB_DISABLE_OS_PROBER=true
GRUB_SAVEDEFAULT=true
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
 
Old 05-11-2019, 05:39 AM   #13
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
UPDATE:

I managed to boot into kernel of my choice by changing order of "menuentry" in /boot/grub/grub.cfg. However this is not a solution, rather a quick and dirty hack ;/

So everytime I will update-grub I will lose my settings too...

Last edited by mra90; 05-11-2019 at 07:30 AM.
 
Old 05-11-2019, 06:39 AM   #14
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
change this
Quote:
GRUB_DEFAULT="gnulinux-4.9.45-upboard+-advanced-d5007568-bf96-4bc4-9723-a0d06b750cb4"
to
Code:
GRUB_DEFAULT=saved
in /etc/default/grub
after selecting the kernel you want to use on the first boot, it should save it for the next boot untill it is changed again.

Last edited by colorpurple21859; 05-11-2019 at 06:43 AM.
 
Old 05-11-2019, 06:47 AM   #15
mra90
LQ Newbie
 
Registered: May 2019
Posts: 15

Original Poster
Rep: Reputation: Disabled
colorpurple21859, I don't see how could it help.

Code:
GRUB_DEFAULT=saved
where do we specify what kernel to boot as default?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB menu not getting updated even after changing /boot/grub/grub.cfg KNSI Linux From Scratch 4 06-20-2018 09:13 PM
GRUB menu not getting updated even after changing /boot/grub/grub.cfg KNSI Linux - Newbie 6 06-20-2018 01:54 PM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration