Most direct (but slightly buggy) way to get Ubuntu-MATE 18.04 on Pi 4.
These procedures were written and validated on 11 August 2019 and used a
laptop with Ubuntu-MATE 18.04 (AMD64 version) as a workstation to store
files and manipulate images, and a Raspberry Pi 3 (not B+ although that
should be Ok as well) as a temporary install machine. I used the most
recent ubuntu-MATE image for 32-bit Raspberry Pi3 which is:
ubuntu-mate-18.04.2-beta1-desktop-armhf+raspi-ext4.img (uncompressed) and
the Raspbian Buster install (updated to kernel 4.19-58). Any instances of
'' refer to your local user account name, and the procedures assume
that you work from your local home directory.
-
Install and update Raspbian on your Pi 4 per Raspberry Pi instructions.
After all files are updated, insert the microSD card in a computer (I used a
Ubuntu-MATE AMD64 installation with a SD-to-microSD adapter so that the
system is mounted on /media//boot and /media//rootfs). In your
local workspace create three directories; 'Boot', 'libModules' and
'libFirmware' and copy files from the microSD card to these directories as:sudo cp -rp /media/<user>/boot/* Boot/ sudo cp -rp /media/<user>/rootfs/lib/modules/* libModules/ sudo cp -rp /media/<user>/rootfs/lib/firmware/* libFirmware/
-
Umount and remove the Raspbian installation. Insert a microSD card on
which to install Ubuntu-MATE and unmount any partitions that automount with
commands such as: sudo umount /dev/mmcblk0p1 -
Assuming you have already downloaded the Ubuntu-MATE 32-bit image as
cited above, install it on the microSD card (I use the old, slow way with:
sudo dd if=ubuntu-mate-18.04.2-beta1-desktop-armhf+raspi-ext4.img of=/dev/mmcblk0 bs=1024K
)
When complete, remove the card and install it in
a Raspberry Pi 3. Boot the machine and complete the installation and
configuration as you desire. When you are satisfied with the configuration,
power down the Raspberry Pi, remove the microSD card and mount it in your
workstation. -
The directory structure of Raspbian and Ubuntu-MATE differ particularly
in the /boot partition and we will clear out some of the Ubuntu-MATE
structure to allow the Pi 4 to boot. First clean out some files not needed
in the final product:sudo rm -rf /media/<user>/system-boot/* sudo rm -rf /media/<user>/writable/lib/firmware/* sudo rm /media/<user>/writable/initrd.img* sudo rm /media/<user>/writable/vmlinuz*
and install our saved data from the Raspbian installation as:
sudo cp -rp Boot/* /media/<user>/system-boot/ sudo cp -rp libFirmware/* /media/<user>/writable/lib/firmware/ sudo cp -rp libModules/* /media/<user>/writable/lib/modules/
-
Now we need to tell the new image where to find files, so we need the
identification of the new image partitions. I ran:ls -lF /dev/disk/by-partuuid
which resulted in the following for the microSD card partitions:
lrwxrwxrwx 1 root root 15 Aug 9 13:27 a91cf5fc-01 -> ../../mmcblk0p1 lrwxrwxrwx 1 root root 15 Aug 9 13:27 a91cf5fc-02 -> ../../mmcblk0p2
-
Using your favorite editor (after the 'jstar' variant of 'joe', I use
vim.tiny), edit/media/<user>/system-boot/cmdline.txt
and replace the
PARTUUID value in the line with the value you just read above which ends
with '-02'. This tells the Raspbian boot sequence where to find the Root
partition. We will keep the LABEL references in the/etc/fstab
image for
now, so there is no need to edit that file for the PARTUUID, but you do need
to edit it to reflect the correct /boot reference, so edit
/media/<user>/writable/etc/fstab
and change the entry reading
'/boot/firmware' to just '/boot'. -
We also need to disable the accelerated graphics on the Pi4 since the
version of Mesa in Ubuntu 18.04 is too old. Do this by editing
/media/<user>/system-boot/config.txt
and commenting out (by placing a '#'
in front of) the line near the end: 'dtoverlay=vc4-fkms-v3d'. If you do not
/do this, you will be restricted to command-line only. (NOTE: this makes it
the same as the line in the [all] section)
Now you are ready for the big smoke test. Insert the microSD card in your
Pi4 and turn it on! Have patience since there is a lot going on behind the
scenes in the system. You should first see the 4 Raspberries, then the
Raspbian scripts followed by a quick switch to the Ubuntu-MATE symbol and then
a blank screen for a couple of minutes before the login screen appears. I
don't know why the delay is happening, but this does give you a way to get
Ubuntu-MATE 18.04 up on a Raspberry Pi 4.
After the seemingly interminable wait, you may now log into the system and
have a functioning system just as you configured on the Pi 3 system. You
will need to reconfigure the wifi (if used) since the new hardware will not
recognize the earlier Pi 3 configuration.
Hal