Install Ubuntu 16.04 MATE or Ubuntu 18.04 On Raspberry Pi

Objective

Install Ubuntu 16.04 MATE or Ubuntu 18.04 on a Raspberry Pi 3

Distributions

You can do this from any Linux distribution.

Requirements

A working Linux install with root privileges, a Raspberry Pi 3, A compatible Pi charger, a MicroSD card, and a compatible card reader for your computer. You’ll also need separate peripherals for the Pi.

Conventions

  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – given linux commands to be executed as a regular non-privileged user

Introduction

Ubuntu is the most popular Linux distribution, and the Raspberry Pi is easily the most popular single board computer… ever. So, it seems like a perfect match, right?

While setting up Ubuntu on the Raspberry Pi is easy, there isn’t an official Ubuntu desktop image for the Pi. Actually, the only official image for the Pi is the IoT focused Ubuntu Core. That’s probably not the version of Ubuntu that you’re thinking about for your Raspberry Pi projects, though.

Instead, there are a couple of options to get a more traditional Ubuntu experience on your Raspberry Pi.

Get The Image

The two options come in the form of an unsupported minimal server install and a ready configured image of Ubuntu MATE. The simplest option here is the Ubuntu MATE image. It’s ready to go as soon as you flash it. If you need something else specific, though, go for the server image.



Ubuntu Server(Unofficial)

You can find the server images under the “Unofficial” heading on Ubuntu’s Raspberry Pi page. If you want a direct download, you can use wget.

$ wget https://www.finnie.org/software/raspberrypi/ubuntu-rpi3/ubuntu-18.04-preinstalled-server-armhf+raspi3.img.xz

Once the image is done downloading, unpack it.

$ unxz ubuntu-18.04-preinstalled-server-armhf+raspi3.img.xz

The image will expand into a much larger file.

Ubuntu MATE

The Ubuntu MATE spin offers their own official image for the Pi. As of this article, there isn’t a release for Ubuntu Bionic yet, but one will certainly be coming. Check their download page for updates. If you just want a direct download of Ubuntu 16.04, use wget.

$ wget https://ubuntu-mate.org/raspberry-pi/ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz

Once you have it, unpack it.

$ unxz ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz

Flash The Image

Insert your MicroSD card into your computer. Don’t mount it. Check in /dev/ to see where it’s located. You can use a graphical tool like gparted to look too.

Once you know where your card is, you can use dd to flash the image.



$ sudo dd if=/path/to/ubuntu.img of=/dev/sdb bs=8M

Make absolutely certain that you have both paths correct. dd can do some real damage to your system if used improperly.

After dd is done, you can remove the card from your reader. It’s not mounted, so that doesn’t matter.

Start The Pi

You can start putting together your Raspberry Pi system now. Insert your SD card into the Pi. Then, connect up your keyboard, mouse, and monitor to the Pi. If you’re going to use a wired connection for the Pi, connect that now too. When everything else is in place, plug the Pi in.

The Raspberry Pi will take the next few minutes to set itself up. The Pi automatically resizes the partitions provided by your disk image to fill the available space.

Both the MATE image and the server are complete Ubuntu installs. They’re ready to go. So, when the Pi is done, it will automatically boot into Ubuntu.

If you have the MATE image, you’ll get the graphical MATE desktop. The server will give you a command prompt. Through that, you’ll be able to install the packages you want.

Install A Desktop(Ubuntu Server)

If you did elect to use the server image, you do have the option of installing a desktop environment with Apt. There are three options available.

$ sudo apt-get install xubuntu-desktop
$ sudo apt-get install lubuntu-desktop
$ sudo apt-get install kubuntu-desktop

Unity and GNOME don’t work. Plasma will, but it’s slow. Your best options are either XFCE or LXDE.

Closing Thoughts

That’s it! You have a working Ubuntu install on a Raspberry Pi. You can update and maintain your system as you normally would.