Skip to content

Instantly share code, notes, and snippets.

@fathulfahmy
Last active September 28, 2025 05:43
Show Gist options
  • Select an option

  • Save fathulfahmy/9977afd558e8a1e59a1ba90a9f22abbb to your computer and use it in GitHub Desktop.

Select an option

Save fathulfahmy/9977afd558e8a1e59a1ba90a9f22abbb to your computer and use it in GitHub Desktop.
Fix update-grub command not found on Linux

How to fix update-grub command not found on Linux

Prerequisites

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

Method 1: Use grub2-mkconfig to update grub

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

Method 2: Create update-grub command

  1. Create update-grub
cd
sudo vim /usr/sbin/update-grub
  1. Edit update-grub
#!/bin/sh
set -e
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg "$@"
  1. Set permissions
sudo chown root:root /usr/sbin/update-grub
sudo chmod 777 /usr/sbin/update-grub
  1. Run command
update-grub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment