Zorin 16 installation error

I cannot complete the installation , grub-efi-amd64-package failed error during installation.

If a hard drive does not have an existing EFI partition, then launching from EFI USB will not work, as there is no EFI start point. An ESP is a FAT32 partition with a flag that tells the EFI BIOS to look inside it for boot information.

You can try reburning your USB stick as not EFI and that should work.

Otherwise, let's cover what to do if your only option is to boot from what you have:
Boot up your USB and choose "Try Zorin" - do not run the installer, yet. Hit ctrl+alt+t to open a terminal and enter into it:

sudo fdisk -l

Below, I will paste an excerpt I saved to my computer from a webpage- that it has been long enough I no longer remember (Credit to whoever)

Identify from them the drive that has the Linux partitions, in my case /dev/sdb. I'll call it /dev/sdX from now on.
Also identify the partition that contains the root filesystem. I will call it /dev/sdXY from now on.
Launch GParted from the Terminal:
sudo gparted /dev/sdX
Why not just click on GParted on your desktop? Well, I kept receiving errors about the Ubuntu Linux bootable USB stick because it was already in use. Of course it is, I am using it to run the computer off it, duh!
Resize the first partition on disk to have another 200 Mb of free space after it.
Create a new partition on the free space, changing the file system to fat32.
Apply operations. You need to do that now for the next step to be possible.
Right click the new partition.
Click on Manage Flags.
Set the boot and esp flags. This is what makes the partition "special" to the EFI BIOS.
One more thing! Note down the the partition that contains the ESP filesystem. I will call it /dev/sdXZ from now on.
Make sure the Ubuntu installation on the external HDD can see the ESP
The new ESP on the external drive must be visible by the Ubuntu installation in the HDD. Otherwise GRUB2, the Linux bootloader, won't be able to update itself, making your system unbootable after the next kernel update at the latest.
Launch GParted from the Terminal, as we saw above:
sudo gparted /dev/sdX
Double-click the partition with your Linux root (/) filesystem on the external HDD
Note down the UUID, e.g. 01234567-89ab-cdef-0123-4567890abcde
Double-click the new FAT32 partition and note down the UUID, e.g. 0123-ABCD
Close GParted
Open a Terminal
The process is different depending on the format of your root partition on the external hard disk.
If you DID NOT use btrfs (e.g. you used ext4)
sudo umount /media/ubuntu/01234567-89ab-cdef-0123-4567890abcde
sudo mount /dev/sdXY /mnt
If you DID use btrfs
If you DID use btrfs, you made your life complicated. We need to mount the btrfs subvolume containing the root partition instead of the entire partition. Otherwise you'll never be able to install GRUB and you'll probably lose an entire day, like me.
btrfs subvolume list /media/ubuntu/01234567-89ab-cdef-0123-4567890abcde
This will give you a line with a numeric ID. Let's say 123. Note it down.
umount /media/ubuntu/01234567-89ab-cdef-0123-4567890abcde mount /dev/sdXY -o subvolid=123 /mnt
The rest of the instructions are common, no matter if used btrfs, ext4 or something else
sudo nano /mnt/etc/fstab
There is a line with /boot/efi already in this file. Comment it by placing a # in front of it.
Add the following line:
UUID=0123-ABCD /boot/efi vfat defaults 0 1
Install GRUB2 on the external drive's EFI System Partition
Right now our external drive has an empty ESP. We need to put a bootloader in it to make it actually, well, bootable.
First caveat: all the instructions you find on-line assume you are using a dual boot system with Windows or macOS. When you have an external drive it is critical that you use the --removable option in the last step. This installs the EFI bootloader under the special "fallback path" EFI\Boot\bootx64.efi in the ESP. Normally this not supposed to be used for permanently installed Operating Systems. It's the mechanism used by EFI BIOS to boot arbitrary external media. Technically, that's exactly what our external hard drive is: arbitrary external media!
Second caveat: installing the bootloader is only possible from inside the Linux installation we want to boot. However, we need the bootloader to boot that installation, leading to a Catch-22 issue. The solution is to run the bootloader installation through a chroot jail. The actual caveat that got me stumped for a day comes from the fact that I am using btrfs (because it's so much better for SSDs!). btrfs has subvolumes. If you mount the entire partition instead of a subvolume the grub-install script can't figure out the mapping between paths and devices, therefore failing to install itself on the ESP, returning the cryptic error:
/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).
The error is misleading! /dev is mounted if you follow my instructions below. The actual problem, as I understand it, is that there is a discrepancy between the mounted device and the path to the chroot root. That's why I had you mount only the subvolume containing the root filesystem in the steps above. If you were not paying attention, you are not following the instructions step-by-step, you rebooted before this step or just came here directly looking for a solution to your problem about GRUB not installing look above for instructions on mounting the correct btrfs subvolume.
We need to prepare the chroot environment. The ESP must be mounted in the correct place and we have to bind system mount point for some special trees (most notably /dev). Moreover, we will copy the resolv.conf file to let the chroot environment have network access should it need it.
mount /dev/sdXZ /mnt/boot/efi for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt/$i; done cp /etc/resolv.conf /mnt/etc/ modprobe efivars
Finally we enter the chroot environment and install Grub in a way suitable for a removable device (see the first caveat above).
sudo chroot /mnt
`grub-install -d /usr/lib/grub/x86_64-efi --efi-directory=/boot/efi/ --removable /dev/sdX '
Now your external HDD is bootable. Reboot your computer, select it from the boot media selection of your UEFI BIOS and you're done!

1 Like