The short answer is "yes, you can safely remove GRUB if rEFInd works for you." There are some caveats, though. Most notably, it's always possible that something in the future will break. For instance, there's bug #1649326, which is preventing kernels 3.13.0-101 through at least 3.13.0-106 from booting via rEFInd (or any other method that relies on the EFI stub loader). That said, given the way Ubuntu keeps the currently-booted kernel installed, even if you ran into a problem like this, it should be possible to boot the old kernel via rEFInd, either indefinitely or until a real solution is found.
As to how to remove GRUB, the following command should delete the packages:
dpkg -P grub-efi-amd64 grub-efi-amd64-signed grub-common grub-efi-amd64-bin \
grub-common grub2-common shim-signed
There are three caveats:
- Package changes might necessitate a change to the preceding package list. (That list is taken from this page of the rEFInd documentation, which I wrote a couple months ago.)
- This command removes the packages, but not the GRUB binary on the ESP. To delete that, you'll need to type
sudo rm -rf /boot/efi/EFI/ubuntu.
- Ubuntu is likely to try to add GRUB back. To deal with this issue, I personally employ an empty "dummy" package that claims to be GRUB 3. You can download it from here, if you care to use it. Since it claims to be GRUB 3, Ubuntu won't try to replace it with GRUB 2.
Alternatively, you could delete the files on the ESP and then simply lock the installed GRUB version with a command like this:
apt-mark hold grub-efi-amd64 grub-efi-amd64-signed grub-common \
grub-efi-amd64-bin grub-common grub2-common
This should keep GRUB off the ESP and prevent future GRUB updates, although your current GRUB package will technically remain installed.
A third possibility is to use
refind.conf to keep Ubuntu's GRUB out of the rEFInd menu. This solution won't remove GRUB at all, which has the advantage that it should remain accessible via the computer's built-in boot manager should it ever be needed. OTOH, if Ubuntu should update GRUB, it will take over as the default boot manager. See this page for more ideas on how to handle such issues.