Skip to content

Running "sudo update-grub" in terminal seems to run twice #329

@vjr

Description

@vjr

What Happened?

I usually run sudo apt update then sudo apt full-upgrade (and also flatpak update) in the terminal instead of (please don't judge me) looking in the about plug or appcenter.

Whenever there's a kernel update I noticed the part where it processes /etc/default/grub seems to run twice. I can repro this by just doing sudo update-grub which causes it to seem to run twice with output such as the following:

vishal@blackbird:~$ sudo update-grub
[sudo] password for vishal: 
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found theme: /boot/grub/themes/whitesur/theme.txt
Found background image: /boot/grub/themes/whitesur/background.jpg
Found linux image: /boot/vmlinuz-6.8.0-53-generic
Found initrd image: /boot/initrd.img-6.8.0-53-generic
Found linux image: /boot/vmlinuz-6.8.0-52-generic
Found initrd image: /boot/initrd.img-6.8.0-52-generic
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found theme: /boot/grub/themes/whitesur/theme.txt
Found background image: /boot/grub/themes/whitesur/background.jpg
Found linux image: /boot/vmlinuz-6.8.0-53-generic
Found initrd image: /boot/initrd.img-6.8.0-53-generic
Found linux image: /boot/vmlinuz-6.8.0-52-generic
Found initrd image: /boot/initrd.img-6.8.0-52-generic
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
vishal@blackbird:~$

I have multiple OS installations in a "penta-boot" including Windows and the above was run with temporarily setting GRUB_DISABLE_OS_PROBER=true in /etc/default/grub if this is relevant to the issue. Here is the output of sudo update-grub with the option set to false just FYI but the issue occurs with the flag set to true as shown above:

vishal@blackbird:~$ sudo update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found theme: /boot/grub/themes/whitesur/theme.txt
Found background image: /boot/grub/themes/whitesur/background.jpg
Found linux image: /boot/vmlinuz-6.8.0-53-generic
Found initrd image: /boot/initrd.img-6.8.0-53-generic
Found linux image: /boot/vmlinuz-6.8.0-52-generic
Found initrd image: /boot/initrd.img-6.8.0-52-generic
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
Found KDE neon User Edition (24.04) on /dev/nvme0n1p7
Found openSUSE Tumbleweed on /dev/nvme0n1p8
Found Debian GNU/Linux trixie/sid on /dev/nvme0n1p9
done
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found theme: /boot/grub/themes/whitesur/theme.txt
Found background image: /boot/grub/themes/whitesur/background.jpg
Found linux image: /boot/vmlinuz-6.8.0-53-generic
Found initrd image: /boot/initrd.img-6.8.0-53-generic
Found linux image: /boot/vmlinuz-6.8.0-52-generic
Found initrd image: /boot/initrd.img-6.8.0-52-generic
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
Found KDE neon User Edition (24.04) on /dev/nvme0n1p7
Found openSUSE Tumbleweed on /dev/nvme0n1p8
Found Debian GNU/Linux trixie/sid on /dev/nvme0n1p9
done
vishal@blackbird:~$

Steps to Reproduce

  1. Run sudo update-grub in the terminal.
  2. Observe Sourcing file '/etc/default/grub' happening twice.

Expected Behavior

Should appear to run (print the Sourcing file '/etc/default/grub' and related output) only once.

Host OS

elementary OS 8 (Circe) daily.

Image Version

elementary OS 8 daily running on bare metal as the main OS with other OS's installed alongside.

Hardware Platform

64-bit AMD/Intel (x86)

Log Output

Hardware Info

No response

Contents of /etc/default/grub

etc_default_grub.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: LowOn the radar, but not the most urgent thingStatus: ConfirmedVerified by someone other than the reporter

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions