These days, computers come with UEFI, Unified Extensible Firmware Interface, which is an upgrade from traditional legacy BIOS. With UEFI, Linux installation may fail with the following error message:
grub-efi-amd64-signed failed installation /target/ Ubuntu 16.04
If this message appears, here is what you need to do.
First, create EFI partition on your disk. That is, boot your system from the Linux installation media, which typically has gparted. Open up gparted, create a partition such that the first partition on the disk is FAT32 with 200MB of size.
Second, set esp and boot flags for this FAT32 partition from gparted. This will indicate that this partition is for EFI.
Now that you proceed to Linux installation, and select the disk with EFI partition for boot loader installation. Do not choose the partition itself; select the entire disk such as /dev/sda. Now it should work!