New to linux: how to install updated version grub2

Asked by Andrew G

I have recently installed Ubuntu as the primary/only OS on my old MacBook.
However, I am experiencing a problem with the grub2 boot-loader as discussed here:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1814403

(i.e. the boot-loader *always* appears and will not change from a *30s countdown* despite setting changes in /etc/default/grub.)

According to the above link, this problem has now been fixed in 'grub2 - 2.02+dfsg1-5ubuntu8.2'.

However, I am new to linux and have no idea how to do this. I assume I should download the update from here (?):
https://launchpad.net/ubuntu/+source/grub2/2.02+dfsg1-5ubuntu8.2

...please could someone provide some instructions to install this.

Thanks in advance!

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Andrew G (andrew700) said :
#1

Just to clarify (in case someone asks), I was running 'update-grub' after updating '/etc/default/grub'. So I am very confident the problem I have is as per the bug report and that I need to install this update.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

What is the output of:

cat -n /etc/default/grub; echo; lsb_release -a; uname -a

Thanks

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Please also provide the output that you receive for the command

apt-cache policy grub-common grub2-common

Revision history for this message
Andrew G (andrew700) said :
#4

Thank you! The output is as as follows:

andrew@andrew-MacBook:~$ cat -n /etc/default/grub; echo; lsb_release -a; uname -a
     1 # If you change this file, run 'update-grub' afterwards to update
     2 # /boot/grub/grub.cfg.
     3 # For full documentation of the options in this file, see:
     4 # info -f grub -n 'Simple configuration'
     5
     6 GRUB_DEFAULT=0
     7 GRUB_TIMEOUT=0
     8 GRUB_TIMEOUT_STYLE='hidden'
     9 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    10 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    11 GRUB_CMDLINE_LINUX=""
    12 GRUB_RECORDFAIL_TIMEOUT=5
    13
    14 # Uncomment to enable BadRAM filtering, modify to suit your needs
    15 # This works with Linux (no patch required) and with any kernel that obtains
    16 # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
    17 #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
    18
    19 # Uncomment to disable graphical terminal (grub-pc only)
    20 #GRUB_TERMINAL=console
    21
    22 # The resolution used on graphical terminal
    23 # note that you can use only modes which your graphic card supports via VBE
    24 # you can see them in real GRUB with the command `vbeinfo'
    25 #GRUB_GFXMODE=640x480
    26
    27 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
    28 #GRUB_DISABLE_LINUX_UUID=true
    29
    30 # Uncomment to disable generation of recovery mode menu entries
    31 #GRUB_DISABLE_RECOVERY="true"
    32
    33 # Uncomment to get a beep at grub start
    34 #GRUB_INIT_TUNE="480 440 1"

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
Linux andrew-MacBook 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Andrew G (andrew700) said :
#5

... and also:

apt-cache policy grub-common grub2-common
grub-common:
  Installed: 2.02-2ubuntu8.14
  Candidate: 2.02-2ubuntu8.14
  Version table:
 *** 2.02-2ubuntu8.14 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.02-2ubuntu8 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
grub2-common:
  Installed: 2.02-2ubuntu8.14
  Candidate: 2.02-2ubuntu8.14
  Version table:
 *** 2.02-2ubuntu8.14 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.02-2ubuntu8 500
        500 http://gb.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

The version of grub2 installed on your system (2.02-2ubuntu8.14), is newer that the one you are looking for (2.02+dfsg1-5ubuntu8.2). Installing that other version will not help.

Which messages do you receive for the command
sudo update-grub

Revision history for this message
Andrew G (andrew700) said :
#7

Ah, okay. Output as follows:

sudo update-grub

Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.3.0-40-generic
Found initrd image: /boot/initrd.img-5.3.0-40-generic
Found linux image: /boot/vmlinuz-5.3.0-28-generic
Found initrd image: /boot/initrd.img-5.3.0-28-generic
done

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

If you change:
GRUB_TIMEOUT=0

To:
GRUB_TIMEOUT=1

Then run:
sudo update-grub

Does it help?

Revision history for this message
Andrew G (andrew700) said :
#9

I should point out that the boot-loader did reduce to a 5 second countdown with 'GRUB_RECORDFAIL_TIMEOUT=5'

But 'GRUB_DEFAULT=0' and 'GRUB_TIMEOUT=0' appear to have no effect.

Revision history for this message
Andrew G (andrew700) said :
#10

Replying to actionparsnip, I have tried

sudo nano /etc/default/grub # GRUB_TIMEOUT=1
sudo update-grub

and restarted MacBook, but no effect.

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

What is the output of

grep -i timeout /boot/grub/grub.cfg

Revision history for this message
Andrew G (andrew700) said :
#12

Replying to Manfred Hampl,

andrew@andrew-MacBook:~$ grep -i timeout /boot/grub/grub.cfg
  set timeout=5
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=1
  # Fallback hidden-timeout code in case the timeout_style feature is
    set timeout=0
  set timeout=5
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu

Thank you.

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

GRUB_RECORDFAIL_TIMEOUT is used only when booting after a total system crash or irregular shutdown.
A boot after a normal and valid shutdown should use the value for GRUB_TIMEOUT as waiting time.

How do you usually close down your system?

Revision history for this message
Andrew G (andrew700) said :
#14

I shut down via 'Power Off' option on the Ubuntu the 'Power Off' GUI (which I launch by my MacBook power button or by the menu bar).

Revision history for this message
Manfred Hampl (m-hampl) said :
#15

With the parameters set to 5 and 1, how long does the menu show now?

Revision history for this message
Andrew G (andrew700) said :
#16

Hi Manfred,

The Boot loader appears and counts down 5 seconds with the following settings:

GRUB_DEFAULT=0
GRUB_TIMEOUT=1
GRUB_TIMEOUT_STYLE='hidden'
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
GRUB_RECORDFAIL_TIMEOUT=5

Revision history for this message
ted jenson (tedjenson90) said :
#17

1 Create a configuration file for GRUB2.

# grub2-mkconfig -o /boot/grub2/grub.cfg

2 List block devices available on the system.

$ lsblk

3 Identify the primary hard disk. Usually, it is the sda device.

4 Install GRUB2 in the MBR of the primary hard disk.

# grub2-install /dev/sda

5 Reboot your computer to boot with the newly installed bootloader.

Can you help with this problem?

Provide an answer of your own, or ask Andrew G for more information if necessary.

To post a message you must log in.