This can be done via one line of commmand but before that make sure:
-
You have a backup of your
grubx64.efi
file. -
You have a bootable rescue CD/USB (like Ubuntu or Archlinux).
The grubx64.efi
file path is usually at /boot/efi/EFI/distro/grubx64.efi
.