Why 12.04 Fails to install grub-efi to /target/?

This error was solved for me by making sure there was an internet connection available to the installer.

When I chose not to connect I got this error.


In my case, I skip install grub by running ubiquity from terminal using the following command:

ubiquity -b

It also means that you have to install grub by your bare hand.

After ubuntu has been installed. DON'T restart because you haven't had bootloader yet. You have to install grub on your pc.

sudo mount /dev/sdXY /mnt

sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys

sudo chroot /mnt

grub-install /dev/sdX

grub-install --recheck /dev/sdX

update-grub

This link will help you: http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd

Update: Thanks for Mikko Östlund's comment.

In case you separate your EFI system partition and Ubuntu partition, when running grub-install /dev/sdX you may get error message cannot find EFI directory. You have to do mount /dev/sdXY /boot/efi. Then run the grub-install /dev/sdX and the remaining commands with success. And reboot.


Ubuntu's been making slow but steady improvements in its EFI support for the last several versions, so yes, there are differences between 12.04 and 12.10 that could be important. That said, the fact that you got a bunch of dependency errors when you tried to install grub-efi suggests that a more fundamental problem might be the root cause -- perhaps there was a network problem that prevented a string of other packages from installing, for instance. If so, trying again at a later time might correct matters.

That said, on an EFI system, IMHO it's better to use 12.10 than 12.04. This is especially true if it's a recent computer that shipped with Windows 8, since such computers also invariably use Secure Boot, which Ubuntu 12.10 supports but Ubuntu 12.04 doesn't. This isn't the root cause of your problem, though, since 12.04's installation disc won't boot at all if Secure Boot is active; I mention it only for the benefit of others who might read this page.