Ubuntu on Raspberry Pi

Step-by-step guide on how to install Ubuntu server with MATE desktop environment on Raspberry Pi.

Install Ubuntu with Mate desktop

I tried Ubuntu several times during the past year. The server worked flawlessly. It is a 64bit operating system. Installations seem very fast, faster than installations on Raspberry Pi OS. No issues whatsoever. But, when it came to installing a desktop environment I always had problems. I used the official Ubuntu way of installing DE – sudo apt-get install kubuntu-desktop. It seemed that the installation went fine. There were no errors. Yet, after a reboot, I got a black screen. Nothing. No login prompt, no errors, just a black screen. I tried it a few times and gave up.

Recently I came across an interesting project called desktopify. It is a script that installs desktop environment of your choice on Ubuntu. It seemed interesting enough to try Ubuntu once more. This time I wasn’t disappointed. The installation process is very quick. The script does not install unnecessary applications. Installation is light and snappy. Perfect. Finally, I had a chance to play with Ubuntu.

So let’s see how to install Ubuntu on Raspberry Pi. Next, we will install MATE desktop environment using the desktopify script.

What you will need
This guide covers

1. The Raspberry Pi Imager

We need to flash the Ubuntu operating system image onto SD card. The Raspberry Pi Imager lets us do that without downloading any images. Download the latest Raspberry Pi Imager if you don’t have it yet.

raspberry pi imager

2. Select operating system

Clicking the “CHOOSE OS” button opens a menu with several operating system choices. Navigate to Ubuntu and select it.

This will open up another menu. Here we can select different versions of the Ubuntu operating systems. 20.04.1 is the latest version. Since I wanted a 64bit operating system I selected the second option from the top. Clicking on the OS version closed the “CHOOSE OS” menu.

raspberry pi imager ubuntu selection

3. Selecting where the OS will be installed

You have to be very careful during this step! If you select the wrong destination, your disk will be overwritten with the Ubuntu OS. You will lose data!

Clicking the “CHOOSE SD CARD” opens up the destination disk menu. Select your SD card by clicking on it. This will close the target disk menu.

raspberry pi images sd card selection

4. Writing OS image to the SD card

raspberry pi imager flashing ubuntu

The last step in flashing the SD card is writing the selected operating system image to the card. Clicking the “WRITE” button starts this process. Depending on the speed rating of the card and size of the selected image, this procedure should take 5 to 10 minus.

When a completion message appears on the screen, the SD card can be removed from the reader.

5. Booting up Ubuntu for the first time

Insert the SD card into your Raspberry Pi and connect it to power. Raspberry will boot up and the login prompt will appear on the screen but don’t log in just yet. During the first boot, a lot is going on behind the scenes. Scripts are running in the background setting up our new operating system. Wait for 2-3 minutes before you login. The default user name is ubuntu and the password is ubuntu. You will be asked to change the password during your first login.

6. Add ubuntu user to sudoers group (optional step)

This step is optional. If you want to keep your system as secure as possible skip this section and go to step number 7. 

I appreciate the default security of Ubuntu but I am the only person accessing my system. At this time my Raspberry is not accessible from the Internet. I do not keep any sensitive data on it. I don’t even log in to any website from my Raspberry. If something unforeseen should happen, I can quickly reinstall the system. I know the risk associated with adding myself to the sudoers group. In this case, I am sacrificing a little bit of security for convenience. Why? Because I don’t want to type my password every time I need to edit a configuration file. I do not want to type it to execute a command requiring sudo privileges.

If you want to avoid entering your password, edit the sudoers file with the command below.

				
					
sudo nano /etc/sudoers
				
			

Scroll down to the section called “# Allow members of group sudo to execute any command” and add the following line

				
					
ubuntu ALL=(ALL:ALL) NOPASSWD: ALL
				
			

Close modified file by pressing the control + x keys. Press y to save the modified buffer and enter to wire the change to the /etc/sudoers file. Done. You will not have to enter your password to execute commands with sudo privileges.

7. Update and upgrade Ubuntu operating system

Before we begin installing desktop environment, the operating system should be updated and upgraded. Since Raspberry Pi OS and Ubuntu are based on Debian we use the same two commands to perform updates.

				
					
sudo apt update && sudo apt -y upgrade
				
			

When the upgrade process completes, we can reboot the system.

				
					
sudo reboot
				
			

8. MATE desktop environment installation

At this point installation of Ubuntu is finished. If you do not need desktop environment you can start using the system. However, if you would like to use Raspberry Pi to browse the web or edit documents we need to install DE. As I mentioned at the beginning, I use the desktopify script to get the job done. Execute the three commands below and MATE will be installed on your system in a few minutes.

				
					
git clone https://github.com/wimpysworld/desktopify.git 
cd desktopify 
sudo ./desktopify --de ubuntu-mate
				
			

You can use desktopify script to install other desktop environments including:

Simply replace ubuntu-mate in the sudo ./desktopify –de ubuntu-mate command with one of the above options. I have not tried other desktop environments. But if there is enough interest, I will put together another step-by-step guide. Let me know in the comments on U Press Me Facebook page.

Done. Ubuntu and MATE desktop are now installed. The last step is to reboot the system.

				
					
sudo reboot
				
			

When the system boots up you should be greeted by the MATE login screen. This is almost an end to the “how to install Ubuntu on Raspberry Pi” guide. I said almost because Ubuntu has a couple of annoying features or quirks. Fortunately, these issues can be fixed easily.

Issues you may encounter and how to fix them

9. How to install RealVNC server on Ubuntu

Why RealVNC? There is nothing wrong with TightVNC or UltraVNC but RealVNC is so easy. It works right out of the box. The problem is that it is not in the Ubuntu package repository. In the How to install RealVNC on Ubuntu tutorial, I will guide you through the process of installing RealVNC.

10. How to fix sound on Ubuntu

Ubuntu server is running. MATE desktop environment is installed, but there is no sound. You can’t hear music and YouTube videos have no sound either. This is because on Raspberry Pi the default audio output goes to the headphone jack. Even if you find a way to enable the sound, the problem is still there. When the system reboots, there is no sound again. Find a permanent solution to the sound output issues in my How to fix sound on Ubuntu guide.

11. How to fix transparency on Ubuntu

You are experimenting with Pantheon or Cupertino panels but can’t get transparency. You double checked Conky configuration, and it still has no transparent background? Maybe you found the setting to make the desktop panel transparent. The problem is, it stops working after each reboot. Head over to How to fix transparency in Ubuntu for a permanent fix.

Share on

Facebook
Twitter
Pinterest
Reddit

Related posts

ubuntu mate without transparency
How to guide

How to fix transparency in Ubuntu

Ubuntu transparency issues Detailed guide on how to permanently fix transparency in Ubuntu with Mate Desktop environment. MATE transparency problems Sooner or later, you may

Read More »
ubuntu mate sound output device settings
How to guide

How to fix sound in Ubuntu

Ubuntu sound issues Step-by-step guide on how to set default sound output device in Ubuntu with MATE desktop environment How to fix sound on Ubuntu

Read More »