Install Grub Bootloader
The command installs the GRUB bootloader for UEFI systems :
sudo grub-install \
--target=x86_64-efi \
--efi-directory=/boot/efi \
--bootloader-id=grub_uefi- sudo grub-install Runs the GRUB installer with administrator privileges.
- –target=x86_64-efi Installs the 64-bit UEFI version of GRUB.
- –efi-directory=/boot/efi Specifies the mount point of the EFI System Partition (ESP). GRUB places its EFI binary (e.g., grubx64.efi) here.
- –bootloader-id=grub_uefi Sets the name of the directory under EFI/ and the name of the UEFI boot entry. Example path created: boot/efi/EFI/grub_uefi
Delete a GRUB entry from UEFI firmware
First list current UEFI boot entries:
sudo efibootmgrFind the entry named grub_uefi (example: Boot0001). Delete it using:
sudo efibootmgr -b 0001 -BReplace 0001 with the actual entry number from your system.
Remove the GRUB directory created in the EFI System Partition:
sudo rm -r /boot/efi/EFI/grub_uefiRestore another bootloader (Optional)
If you rely on another bootloader (e.g., Windows Boot Manager, systemd-boot, or another Linux distribution), ensure it is set as the default boot entry:
List entries:
sudo efibootmgrSet the desired one as default:
sudo efibootmgr -o <order>Where <order> is a comma-separated list of boot numbers (e.g., 0000,0002).