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


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 W3TechsOpens in a new tab.)
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

Master your Raspberry Pi in 30 days
From beginner to expert in Raspberry Pi.
Learn useful Linux skills and practice multiples projects with step-by-step guides.

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 WikipediaOpens in a new tab.

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 pageOpens in a new tab. if you are interested 🙂

Free Download!

Compact list of 20 operating systems available on Raspberry Pi, with direct links to websites, downloads and tutorials

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 linkOpens in a new tab. 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 hereOpens in a new tab. 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 SSHOpens in a new tab., 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 Opens in a new tab.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 on AmazonOpens in a new tab.) that was the only working. It’s a basic model, nothing fancy, but it works very well on Raspberry Pi (any operating system I tried).

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 PCOpens in a new tab.

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 HATOpens in a new tab. for example)
Let me know if you have some experience about that

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

  1. 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?

    1. 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

  2. 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.

  3. 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!

  4. 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!

    1. 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+

  5. Thanks for your clear explanation really helped.
    To be noted that wifi connection on wlan0 seems to only work with 2,4GHz connection. I initially tried on my 5GHz and did not manage but no problem once on the 2.4GHz connection

  6. Have 20.04 32bit with Gnome up and running. Trying to configure UART for serial access.

    have /dev/ttyS0 and /dev/serial1

    With loopback on Pin 8,10 I can’t get port to open or read/write data.

    No RASPI-CONFIG. What do you recommend?

  7. Seems like I need to set the core_freq in config.txt to enable the miniUART on the RPi 4.

    i.e.
    Mini UART and CPU core frequency
    In order to use the mini UART, you need to configure the Raspberry Pi to use a fixed VPU core clock frequency. This is because the mini UART clock is linked to the VPU core clock, so that when the core clock frequency changes, the UART baud rate will also change. The enable_uart and core_freq settings can be added to config.txt to change the behaviour of the mini UART.

    Goal is to set core_freq=250 . How do I do that in Ubuntu 20.04

  8. Patrick,

    Thanks for the good article. …. ~But my experience: I’ve loaded Ubuntu Server onto the Pi a millio times over the last week. Only through trial and error did I learn that an Ethernet chord had to be plugged in or else no. Also, the getting through the “change your” password” procedure is a nightmare. Because what’s happening in the background, at least with Ethernet connected in the foreground, is Ubuntu is setting up an SSH key. So until that finishes, logging in with ubuntu as login name and password is impossible much less resetting the password. So, anyway, eventually Ubuntu (Server 20.04) finishes up with SSH and THEN I can login and change my password. Onto sudo apt update and sudo apt upgrade. SOMETHING is running in the backing in and putting a lock on the upgrade command. I found I could wait it for several minutes, sometimes, longer, and the lock would disappear. Or I could run ps aux | grp apt, find the PIs and then manually kill them (probably we need a better word than “killing” a process) … So even that doesn’t take the lock off but it does get me within 30 seconds of the lock being good enough. Now, prior to installation desktop, I run lsusb to see if Ubuntu Server is seeing my midi keyboard. Yes, it is. But it’s not identifying it with a manufacturer’s name or anything like that whereas dmesg | grey Arturia does identify it. Ok, onwards. I try KUbuntu, Xubuntu, XFCE and install jack (QjackCtl) since I want to use the Pi for audio production. Now, it’s all hit or miss. Some applications work through Jack, many don’t. That’s a problem. I download ubuntustudio-installer to get the music production apps and system tweaks one might want when producing audio. Still, Jack is unreliable. Bottom line is in my experience, yes Ubuntu Server and desktop load and yes it all works with generic applications. But try anything extra with Jack (and be not prepared to troubleshoot during the Server installation) and all is lost. Just my 2 cents and experience …

    1. Hi Mark,

      I have not tested 20.04 for the moment, but your problems are strange.
      For me, everything went well.

      Just a question, what’s your Raspberry Pi model?

  9. The pi website states that 5G is disable until you change the country setting. Then it will enable due to country regulations. It also tells you how to sort other things…

    https://www.raspberrypi.org/documentation/configuration/wireless/desktop.md

    1. Hi Lewis,

      Thanks for the information
      But does this apply to Ubuntu? How do you change the Wi-Fi country?

Leave a Reply to Ben Funar Cancel reply

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

Recent Content