How to Install Ubuntu on Raspberry Pi? (Server, Desktop)

how to install ubuntu on raspberry pi

Ubuntu is my favorite Linux distribution on PC, I’ve been using it for years (even if recent desktop styles don’t suit me)
But on Raspberry Pi, it has always been complicated. I don’t know why, but I never managed to install it properly
I tried again this week, and good news, almost everything works fine
So let’s review this famous operating system!

How to install Ubuntu on Raspberry Pi?
Ubuntu for Pi is available directly on the Ubuntu official website
It’s only the server version, but you can install a desktop package after that
The installation process is straightforward:
– Download the latest Ubuntu image
– Flash it with Etcher
– Start your new system!

In this post, I will do a quick reminder about Ubuntu (if needed), then show you how to install the Server version, and how to upgrade it to your favorite Desktop environment (Gnome, XFCE, LXDE or KDE)

What is Ubuntu?

Presentation

I don’t know if it’s really necessary to do this, but for those who don’t know Ubuntu or need a quick reminder, here it is

Ubuntu is a famous Linux distribution, based on Debian
It’s commonly used by most PC users on Linux, but also on an increasing part of the servers in the world (39.1% according to W3Techs)
Ubuntu is an African word that means “humanity” or “humanity to others” from the Canonical translation

This distribution runs on a shorter development cycle and therefore provides the latest news much earlier than Debian
So, it’s perfect for a desktop system

History

Mark Shuttleworth, a South African billionaire, launched the Ubuntu project in 2004
The goal was to create an easy-to-use alternative to Debian
He created the Canonical company the same year, to manage this project

Ubuntu 4.10 Warty Warthog – The first Ubuntu release
Source: Altonbr at English Wikipedia

The first version was released on October 20, 2004
Since that date, Canonical releases a new version twice a year: in April and October
We’ll see that now in details

Versions

On Ubuntu, versions publish numbers, dates and code names set like a clock:

  • The version number is always on the same format template: YY.MM
    For example, 11.04 is the release of April 2011, and 14.10 is October 2014
  • So, the release date is always in April or October
    There has never been a delay apparently!
  • And the code names also follow a template: Adjective + Animal
    Both starting with the same letter, in a chronological order
    Examples: Utopic Unicorn, Vivid Vervet, Wily Werewolf, etc.

You can check the history of all the Ubuntu versions on this Wikipedia page if you are interested 🙂

Ubuntu Server Installation

After this short introduction, let’s move to the installation part!

Download Ubuntu

Ubuntu exists in three versions for PC :

  • Desktop (the traditional environment with a graphic interface)
  • Server (something minimal close to Raspbian Lite)
  • Core (for IoT projects)

On Raspberry Pi, there is only the Server version available
But you can install a Desktop environment later, and I will show you how

Here is the download link to Ubuntu Server for Raspberry Pi
During writing, it’s available for Raspberry Pi 2, 3 or 4 with two versions: Ubuntu 18.04.4 LTS and Ubuntu 19.10

Choose the one you prefer in the column corresponding to your Raspberry Pi model and click on “Download 32-bit”
For information, I’m writing this post while testing on my Raspberry Pi 4 and Ubuntu 19.10

Flash the SD card

Now, you need to flash the SD card as usual
I recommend using Etcher to do this, as it’s very intuitive:

  • Download Etcher here if you don’t have it yet
    It’s available on any operating system
  • Install Etcher (double-click on the downloaded file on Windows)
  • Start it, a windows like this shows up:
    etcher menu
  • On the left, click on select image and browse to the Ubuntu image location
  • Then insert your SD card into your computer
  • And click “Flash!” to start the SD card creation process

After a few minutes, the SD card is ready to use!

First boot

  • Insert the SD card in your Raspberry Pi
  • Start it and wait a few minutes
  • On the login screen, enter the default username and password: ubuntu / ubuntu
  • Follow the instructions to change it with something different

From here you arrive at an almost empty system, with many packages missing
Yes, it’s the principle of a minimal version, but I like to have at least the basics 🙂

If you plan to use Wi-Fi on this installation, it’s almost impossible to configure it right now
So, I recommend starting with an RJ45 cable if you can
If not, check the next paragraph to know what you need to configure

Once connected to your network, the first thing to do is to update the system:
sudo apt update
sudo apt upgrade

Note: if like me you don’t have a QWERTY keyboard, you can edit the /etc/default/keyboard file and set the XKBLAYOUT option to fit your hardware

Wi-Fi configuration

Here is how to configure the wireless connection on your Raspberry Pi with Ubuntu Server
If possible, I recommend doing this from your computer by using SSH, so you can copy and paste the commands and configuration

Anyway, here is what you need to do:

  • Install the needed packages:
    sudo apt install wireless-tools net-tools ifupdown
  • Then, edit the /etc/network/interfaces configuration file:
    sudo nano /etc/network/interfaces
  • The file is empty, paste these lines into it:
    auto wlan0
    iface wlan0 inet dhcp
    wpa-ssid YOUR_SSID
    wpa-psk YOUR_PASSWORD
  • Save & exit (CTRL+X)
  • Enable the Wi-Fi interface:
    sudo ifup wlan0
  • I think it should work directly (use ifconfig to check)
    If not, reboot your system:
    sudo reboot

From here, there is no big difference with a Raspbian Lite system
You can use the classic Linux commands to manage your device (except the Raspberry Pi ones, there is no raspi-config on Ubuntu)

In the next part, I will show you how to upgrade this Server version with a Desktop interface
I just need to inform you that I didn’t manage to have Wi-Fi working in Gnome, so if it’s your only available connection method, it’s probably better to seek a solution before (I give you a workaround in the next part, but it’s not perfect)

Upgrade Ubuntu Server to Ubuntu Desktop

The main benefit of using Ubuntu rather than Raspbian is the Desktop interface, so let’s look directly how to install it on Ubuntu Server

Choose your desktop environment

If you want to install a desktop environment, you have to make a choice between 4 alternatives:

  • Gnome: the default interface on Ubuntu Desktop
  • KDE (Kubuntu)
  • LXDE (Lubuntu)
  • XFCE (Xubuntu)

It mainly depends on your tastes, so I’ll let you choose the one you prefer
But on a performance level, LXDE and XFCE are probably faster than Gnome and KDE
If you have a Raspberry Pi 4 with 4 GB RAM, it’s probably not a big deal, but on older models, it’s something to consider

Installation

For each desktop environment there is a specific meta package to install:

  • Gnome: ubuntu-desktop
  • KDE: kubuntu-desktop
  • LXDE: lubuntu-desktop
  • XFCE: xubuntu-desktop

To install it, use apt:
sudo apt install <package>

You can add the –no-install-recommends option to avoid the installation of all the default packages (like OpenOffice)
It will require half the download time and the size of the disk space to install
sudo apt install --no-install-recommends <package>

In my case, I’m a player, and I choose Gnome with all default packages:
sudo apt install ubuntu-desktop

Now you have time to take a coffee, the installation process take a little time
I lost the SSH connection during the installation, so it’s probably better to do the installation directly on the screen, but it’s not a problem, after a reboot my installation was complete
sudo reboot

First impressions

After the reboot, the login screen shows up
Choose the Ubuntu user and enter the same password you have set on the Server version
The desktop appears

The Gnome desktop environment on Ubuntu 19.10 / Raspberry Pi version

The interface is not very responsive on Gnome, but it works pretty well anyway
And I suppose it’s probably better on XFCE without all the default packages

I was surprised to see that even applications that I consider heavy like Firefox work well on this system

If I had to update my post “Can a Raspberry Pi really Replace your Desktop PC?“, it’s probably the system I would choose for this

Configuration

Wi-Fi

As I told you previously, the Wi-Fi is not working with the Desktop interface
I don’t understand why, probably because Network Manager is not compatible or something like that
There is probably a solution as this is working without the interface, but I didn’t find it

The only way I managed to get Wi-Fi working is by using a USB dongle
As it was not working with all my Wi-Fi adapters, I give you the reference here if needed
It was my Dlink USB adapter (this one exactly) that was the only working

Once detected, you can configure the Wi-Fi settings from the network icon on the top right of the desktop (pick a SSID in the list and follow the wizard)
Let me know if you find another solution, I would edit this part

Other settings

Ubuntu is one of the most used systems in the world, so you’ll find help effortlessly on Internet
But just to get you started:

  • All the apps are available by clicking on the dots icon at the bottom left of the screen
  • From here, you can scroll to find the app you want or use the search engine
  • All the configuration settings are in the “Settings” app
  • To install a new software you can start the “Ubuntu Software” app in the left panel. It works like an app store on smartphone
  • You can also use apt in a terminal if you prefer
    sudo apt search <name>
    sudo apt install <package>

    Many Raspberry Pi packages are available, like Python libraries and more
    And you can probably add new repositories to expand the possibilities

Conclusion

That’s it for this quick review of Ubuntu on Raspberry Pi
I really like this system, and it’s a good alternative to Raspbian if you are using your Pi as a Desktop PC

I didn’t have time to make more tests with GPIO, I think the basics should be OK, but I’m not sure that everything would work (I didn’t find any package for the Sense HAT for example)
Let me know if you have some experience about that

How useful was this post?

Click on a star to rate it!

Average rating 4.4 / 5. Vote count: 9

No votes so far! Be the first to rate this post.

As you found this post useful...

Spread the word!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

9 comments

  1. Marcel Drolet Reply

    it seem to be very good,, I will test it later.. on Pi-4 4Gig

  2. Robert Reply

    I’m stuck with only WiFi network available, and when I try to run “sudo apt install wireless-tools net-tools ifupdown”, I just get pages of errors and nothing done – it seems like it’s trying to download the packages but obviously can’t connect to the internet.

    Running a Raspberry Pi 4B 4GB. Downloaded the Ubuntu 18.04.4 LTS 64-bit image for the Pi 4.
    Can you help please?

    • Patrick Fromaget Post authorReply

      Hi Robert,

      You get these errors because you have no Internet connection
      I didn’t found how to configure the Wi-Fi without Ethernet
      Maybe you can download the packages from your computer and install them from a USB key?

      Let me know if you find a solution, I could update the post

  3. jenocin Reply

    To configure wifi out of the box

    sudo nano /etc/netplan/50-cloud-init.yaml

    Edit the file like this, spacing is important, indents are 4 spaces, tabs DO NOT work
    ###########
    network:
    ethernets:
    eth0:
    dhcp4: true
    optional: true
    version: 2
    wifis:
    wlan0:
    optional: true
    access-points:
    “network sid here”:
    password: “password here”
    dhcp4: true
    ####

    run the following commands to test, generate, and then apply. The second “generate” command will give you the best description of any configuration errors

    sudo netplan –debug try
    sudo netplan –debug generate
    sudo netplan –debug apply

    After that is applied successfully, the interface can be brought online with the following command or a reboot.

    sudo ip link set wlan0 up

    This has worked out of the box a few times without updating/installing anything.

  4. Neminir Reply

    Thank you very much for this guide, very helpful!
    I still have issue with my display, no way to display in 1920×1080 🙁
    Already tried to use xrandr but get “xrandr: Failed to get size of gamma for output default”
    On raspberry pi 4 4Gb with gnome desktop
    Any hints?
    Thanks!

  5. Joe Reply

    Hi there, I have try to do put Ubuntu server onto my PI 3b and is not working, I downloaded Ubuntu from their site and I got an ISO image, then using Etcher I image the card and point to the ubuntu image, but when I try to boot from it it does not work.
    I have done Rasberry PI OS and that one works just fine.
    Is there any particular download that I should be trying?
    Thanks and keep up the great article’s!

    • Patrick Fromaget Post authorReply

      Hi Joe,

      Did you download the 32 bits version or the 64 bits?
      Also, 20.04 was not yet available during writing, maybe there is something specific with it on 3B+

Leave a Reply to Marcel Drolet Cancel reply

Your email address will not be published. Required fields are marked *