Skip to content

Instantly share code, notes, and snippets.

@fathulfahmy
Last active July 11, 2023 15:58
Show Gist options
  • Save fathulfahmy/9977afd558e8a1e59a1ba90a9f22abbb to your computer and use it in GitHub Desktop.
Save fathulfahmy/9977afd558e8a1e59a1ba90a9f22abbb to your computer and use it in GitHub Desktop.
Fedora update grub command not found

Prerequisites:

sudo dnf install shim os-prober efibootmgr grub2 grub2-efi

Method 1: Use command to update grub

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Method 2: Create update-grub command

Step 1: create update-grub file in usr/sbin

sudo vim /usr/sbin/update-grub

Step 2: Edit update-grub file

#!/bin/sh
set -e
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg "$@"

Step 3: Set permission

sudo chown root:root /usr/sbin/update-grub
sudo chmod 777 /usr/sbin/update-grub

Step 4: Use command

update-grub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment