Table of Contents
• Annotations Used in this How-To
• Caveats Pertaining Ubuntu MATE for the Raspberry Pi
• About This How-To
- Useful Tips
• My Raspberry Pi Says...
• Turning Your Raspberry Pi Off Properly
• Storage Media Care and Feeding
• How to Access the Linux Command Line
- Project Requirements
- Ubuntu MATE Card Setup
- Installing Ubuntu MATE 16.04
- Upgrading to Ubuntu MATE 18.04
- Next Steps
• Things Do Not Sound Right
• Failure Message During Boot
• Links Mentioned in This How-To
I - Introduction
Annotations Used in this How-To
- PI - Action takes place on the Raspberry Pi.
- PC - Action takes place on a PC (Windows or Mac).
- TERM - Action takes place at a Command Line, in a Terminal Window.
- GUI - Action takes place in the Raspberry Pi graphical user interface.
- OPTIONAL - Item is optional.
- Green text - Identifies command line input.
- Purple text - Identifies system elements and labels.
The stock Ubuntu MATE distribution for the Raspberry Pi has several issues:
- The download page says you need a card with a capacity of 6 Gib or greater. The image expands to a little over 8 Gib, so you really need a 16 Gib card or greater; no big deal if you're aware of it.¹
- The fat16 (a.k.a.DOS) partition (/boot in Linux) is 64 Mib in size. The Ubuntu software updater fails because there isn't enough room on the partition for it to run. This leaves running updates from the command line as your only option; doable but annoying.
- The project leaders are having issues creating downloadable images of Ubuntu MATE newer than 16.04, and the latest release is 18.04.¹ It is possible to upgrade to 18.04, but it is very time consuming and interactive. Furthermore, support for the 16.04 release is set to end in April, 2019.
- The Raspberry Pi port of Ubuntu MATE is compiled with the ARMv7 instruction set, not ARMv8. This means that it runs as a 32-bit system instead of 64-bit. Hopefully this is something the project leaders will be able to address in due course.
- The Raspberry Pi Foundation released the Pi 3B+ in March, 2018. The differences between the 3B+ and its predecessors prevent the stock Ubuntu MATE image from booting on it out of the box. Even though the 3B+ can and will run Ubuntu MATE, this author does not know if the next downloadable image will address this matter.¹
This How-To will walk you through the process of creating an Ubuntu MATE installation that:
- Overcomes the /boot partition issue.
- Renders the 16.04 end-of-support issue moot.
- Allows Ubuntu MATE to run on a Raspberry Pi 3B+.
The directions are split into five distinct sections with multiple steps each. At best, the entire process they describe will take several hours to complete. It is assumed that you will want/need to take breaks as you go along, and the best place to do so is at the end of a section. Additional safe stopping places between steps are also identified.
Please note that the author has not attempted to perform the procedures described in this document on a previously installed Ubuntu MATE system; the procedure described here is for a fresh install. The author shall not be held responsible if you choose to perform these steps on a previously installed Ubuntu MATE system and things go wrong. Remember: You can always back up your existing user data and then restore it on the newly created system!
II - Useful Tips
My Raspberry Pi Says...
When the Raspberry Pi is powered up, the first thing it displays is a large color gradient square. Referred to as the Rainbow Square, it quickly goes away once the Pi starts booting from the MicroSD card. If it doesn't go away, the Pi is not able to boot it may be because there is no MicroSD card in the Pi, the card is blank, or the card got clobbered somehow. The on-board LEDs may also flash a in a pattern under these conditions.
The Raspberry Pi can also display one of three icons in the upper-right corner of the screen:
- A yellow lightning bolt, which indicates that the Pi is not getting enough power.
- A partially red thermometer, which indicates a CPU temperature between 80°C and 85°C.
- A fully red thermometer, which indicates a CPU temperature above 85°C.
It is extremely important that you never shut off your Raspberry Pi by simply turning off its power supply! Doing so will likely corrupt the data on all connected storage media.
- In a best case scenario the next boot will take an extremely long time.
- In a worst case scenario the system may not boot at all.
If you do not wish to unplug the power supply once your Raspberry Pi has shut down, you have several options at your disposal:
- Purchase a USB ► MicroUSB cable with an in-line power switch rated for the Raspberry Pi. You will still need to follow the golden rule and do an orderly shutdown first!
- Research and obtain third party add-on hardware that will initiate an orderly shutdown by pressing a button. You will need to research this thoroughly to ensure the add-on actually does this!
To avoid damaging the MicroUSB card and/or the Raspberry Pi, never insert or remove the card while the Raspberry Pi is getting power.
Always unmount (eject) USB flash drives or other storage media before disconnecting it from the Raspberry Pi, as it is almost certain that the data on the card will end up corrupted.
How to Access the Linux Command Line
At various points in this How-To, you will need to access the Linux Command Line. If this is your first experience with Linux, you can access it by opening a Terminal window. Its icon looks like a computer screen, and you will find it:
- On the Menu Bar in Raspbian.
- Under Applications ► System Tools in Ubuntu MATE.
III - Project Requirements
- A Raspberry Pi2 or Pi3.
- One Class 10 MicroSD card, 16 Gib or larger for your Ubuntu MATE system.
- One Class 10 MicroSD card, 8 Gib or larger, with the latest release of Raspbian installed.
Note: If you are starting from scratch, use the NOOBS image and follow the setup directions on the Raspberry Pi web site.
- One USB flash drive with at least 50 Mib of free space.
- One USB SD (or MicroSD) Card Reader.
- One MicroSD ► SD adapter, should your card reader doesn't accept MicroSD directly.
- The Ubuntu MATE 16.04 ISO image.
- PC: SD Formatter, an SD card formatting utility (Win/Mac).
- PC: Etcher, a disk image flashing (writing) utility (Win/Mac).
- PI: GParted, a disk partitioning utility.
- OPTIONAL: Raspberry Pi3 B+.
IV - Preparations
- PC: Prepare the Raspbian NOOBS MicroSD card as per the instructions on the Raspberry Pi web site, and eject it when done.
- PC: Use SD Formatter to format the Ubuntu MATE MicroSD card.
- PC: Use Etcher to write the Ubuntu MATE ISO image to the MicroSD card.
- PC: If Etcher did not do so for you automatically, eject the Ubuntu MATE MicroSD card.
- PI: Insert the Raspbian NOOBS MicroSD card in the Raspberry Pi 2 or Pi 3, and boot it.
- GUI: Look for GParted in the Preferences menu; install it if not found:
- TERM: sudo apt-get install gparted –y
- PI: Connect the USB flash drive.
- GUI: Open the file manager.
- GUI: Copy the folder /lib/firmware/brcm (a.k.a. Firmware) to a folder on the USB flash drive.
- GUI: Copy the content of /boot (a.k.a. Boot Folder) to a folder on the USB flash drive.
- PI: Eject the USB flash drive and set it aside.
V - Ubuntu MATE Card Setup
- Insert the Ubuntu MATE card in the reader.
- PI: Connect the card reader.
- GUI: Launch GParted to adjust partitions:
- Select the card: Typically /dev/sda.
- Right-click and unmount both partitions: /dev/sda1 and /dev/sda2.
- Select the partition called /dev/sda2 (ext4).
- Right-click and select 'Resize/Move', and set 'Free Space Preceding to at least 64 Mib.
Note: You can create additional space to make a larger boot partition. Use increments of 16 Mib if you choose to do this. However, this How-To will continue to assume 64 Mib.
- Select the partition called /dev/sda1 (fat16).
- Right-click and select 'Resize/Move', and set 'Free Space Following to 0.
- Click apply to commit the changes.
Note: If there's a gap between the fat16 and ext4 partitions, repeat the last three steps to fill it by enlarging the fat16 partition. For example, enlarging the partition to 128 Mib typically produces a 1 Mib gap that requires closing.
- Verify the fat16 partition flags are boot and lba. Set them if they are not.
- PI: Shut down the Raspberry Pi, and then unplug it.
- PI: Move the Ubuntu MATE card to the PC.
- PI: Remove the Raspbian NOOBS MicroSD card and put it away.
- PC: Format the fat16 (DOS) partition.
Note: A Windows computer will usually prompt you to format the partition because it can't recognize it.
Caution: Do NOT use SD Formatter, as this will wipe the whole card!
- PC: Mount the USB flash drive.
- PC: Copy the contents of the Boot Folder [from IV.10] to the Ubuntu MATE card.
- PC: Eject the Ubuntu MATE card and the USB flash drive.
VI - Installing Ubuntu MATE 16.04
These instructions must be completed on a Raspberry Pi2 or Pi3, as steps 1 to 7 will not work on a Pi 3B+!
- PI: Insert the Ubuntu MATE card in the Raspberry Pi 2 or Pi 3 and boot it.
- GUI: Go through the system setup.
- GUI: In the Ubuntu MATE Welcome window:
- Click on 'Raspberry Pi Information', and then on 'Resize Now'.
- Reboot when instructed.
- GUI: If necessary, click on the network icon in the menu bar and configure the network connection.
- TERM: sudo BRANCH=stable rpi-update
Note: Do not reboot when this update completes!
- PI: Mount the USB flash drive.
- TERM: sudo su -
- TERM: Copy the Firmware from the flash drive to /lib/firmware/brcm
- PI: Do one of the following:
- If staying on the Raspberry Pi 2 or Pi 3: Reboot.
- If switching to the Raspberry Pi 3B+: Shut down, unplug the Pi, Move the Ubuntu MATE card to the Pi 3B+ and boot it
- PI: Enable the updated Wireless drivers.
Note: On a Raspberry Pi 3B+, this will also enable 5 GHz WiFi.
- TERM: sudo su -
- TERM: rfkill unblock wifi
- TERM: rfkill list
Note: This will return the status of the wireless and Bluetooth connections. If either one shows the presence of a soft or hard block, repeat the unblock.
- TERM: apt-get --no-install-recommends install network-manager
- PI: Reboot to commit the changes.
- PI: If you encounter issues with WiFi after logging in:
- TERM: nmcli dev wifi list
- TERM: nmtui-connect
VII - Upgrading to Ubuntu MATE 18.04
- PI: Bring your Ubuntu MATE 16.04 system up to date.
Note: The first two commands prepare for this and only take a few minutes to do so. The third performs the actual update and might take over an hour to complete based on several factors; do not interrupt it!!! That same step may prompt about replacing a configuration file; since this is a fresh installation, it makes no difference whether you replace it or not. The fourth step performs a cleanup and only takes a few minutes to complete. It is safe to take a break once this fourth step is finished.
- TERM: sudo apt-get autoclean
- TERM: sudo apt-get update
- TERM: sudo apt-get upgrade -y
- TERM: sudo apt-get autoremove -y
- PI: Upgrade your system to Ubuntu MATE 18.04.
Note: The upgrade process will take a minimum of one hour to complete. Once you start it process it cannot be interrupted without consequences. There are four points where you will need to answer some prompts; accept the defaults where applicable.
- TERM: do-release-upgrade
- PI: Reboot the system to commit the upgrade. You can shut down the system instead, if you need to take a break.
- GUI: Under the 'System' menu, launch 'Preferences' ► 'Look and Feel' ► 'MATE Tweak'.
- Select 'Panel' in the sidebar.
- Select the 'Traditional' panel layout from the dropdown menu.
This restores the default panel with all objects, as a glitch causes some of them to disappear during the upgrade. If the Traditional layout shows as active, change it to something else and then change it back to force the reset.
- GUI: Under the 'System' menu, launch 'Administration' ► 'LightDM GTK+ Greeter Settings'.
- On the 'Appearance' Tab, select a background image or color.
The background image for the login/lock screen is invalid. Your choice will correct this.
- OPTIONAL: On the 'Window Position' Tab, re-center the dialog by changing the horizontal value to 50.
- On the 'Appearance' Tab, select a background image or color.
- GUI: Install applications excluded from version upgrades²:
Note:These applications are not part of the online upgrade process; they only ship in downloadable ISO images.
- TERM: sudo snap install ubuntu-mate-welcome --classic -y
- TERM: sudo snap install software-boutique --classic -y
- TERM: sudo snap install pulsemixer -y
VIII - Next Steps
- OPTIONAL: Install useful applications:
- TERM: sudo apt-get install gparted -y
- TERM: sudo apt-get install glances -y
- Install your choice of additional applications.
- Customize the system to your liking.
- Have fun!
IX - Notes
There is a possibility that sound will not work when you first install Ubuntu MATE 16.04. This will definitely be resolved once the system is brought up to date. The audio subsystem will be recognized as Analog Stereo.
After upgrading to Ubuntu MATE 18.04, audio will continue working, but the subsystem will be recognized as Analog Mono. If a fix to this is identified, this How-To will be updated accordingly¹.
Failure Message During Boot
As the Linux boot sequence progresses, status messages are displayed on the screen. After upgrading to Ubuntu MATE 18.04, you will see that one of these status messages reads:
[FAILED] Failed to start Load Kernel Modules.
Along with a description of the error, systemctl status systemd-modules-load.service will list the four modules that could not be activated. The first three of these (lp, ppdev, and parport_pc) are used by Linux to print via a Parallel Port, something the Raspberry Pi does not have. The fourth module (bcm2708_rng) is for the random number generator. If a fix to this is identified, this How-To will be updated accordingly¹.
X - Resources
This How-To was mainly compiled through trial and error. Some of the covered topics are discussed in:
- Raspberry Pi Forums: Ubuntu Mate 18.04???
- Raspberry Pi Forums: Ubuntu image for the new Raspberry Pi 3 B+
XI - Changelog
- Corrected discrepancies in text
- Added instructions for checking that the rfkill command "took"
- Added instructions for eliminating issues with the LightDM GTKGreeter
- Reformatted and reorganized for readability
- Added sections with Pi-related information
- Moved the changelog into the How-To
- Published a PDF version of the How-To
- Corrections and enhancements
- Fixed out-of sequence sub-steps
- Beautified the content
- Added hyperlinks where required
- First publication
¹ - As of October, 2018
² - Packages are part of the downloaded distribution image and must be restored manually