How to install Ubuntu Server on your Raspberry Pi

Updates for the original post/article on Preparing the SD card imager download links from https://www.raspberrypi.org/software/

windows  https://downloads.raspberrypi.org/imager/imager_latest.exe
macos  https://downloads.raspberrypi.org/imager/imager_latest.dmg
ubuntu x86  https://downloads.raspberrypi.org/imager/imager_latest_amd64.deb

To install on Raspberry Pi OS, type `sudo apt install rpi-imager` in a Terminal window.
1 Like

or just

sudo snap install rpi-imager

on any linux that has snap support enabled …

Have you had any luck in finding a solution?

My router doesn’t allow me to assign static ip addresses to my devices.

Installed server and xubuntu-desktop without issue, however the wifi manager does not work. I am still connected to my wifi though. I am guessing because it is “hard wired” per the instructions for getting wifi to work pre desktop install.
How do I undo the hard wire and let the network manager manage my wifi?
Suggest this be added to the instructions.

Good tutorial, but I could never get Wifi to work by editing the config file before first boot. And even the ethernet was a pain. Probably add that one may have to run sudo dhclient eth0 in order to bring the ethernet up, that’s what I had to do in order to get a connection. Very frustrating setup process, haha. Perhaps add the commands to use NetworkManger cli to add a wifi network if you missed the first boot or its not working with the initial boot config file.

1 Like

May I suggest an example of editing the network-config file to give the server a static IP address. Then you don’t need to do all the hunting in arp for the address

A working example:

ethernets:
  eth0:
    addresses:
      - 192.168.101.212/24
    gateway4: 192.168.101.1
    nameservers:
      addresses: [192.168.101.253]
1 Like

Hey Francis o/ - Good idea, would you mind suggesting exactly how you would amend the current tutorial? Then I can publish your suggestion? (We’re working on a better way for helpful folks like you to more easily contribute your ideas) :blush:

In section 3 (https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#3-wifi-or-ethernet):

If you want to use your local lan’s DHCP server to get an IP address for your pi then there are two ways to get your Pi connected to the internet:

  • The first is to connect your Pi to your router with an ethernet cable. In this case, you can skip this step and go to the next one in the tutorial.

  • The second requires a local Wi-Fi network that both your computer and Pi can be connected to. We are going to edit files you just downloaded on your SD card to ensure your Pi can connect to the Wi-Fi network at boot.

If you want to have the pi boot the pi to known IP address then see the section “Set a Static IP” below Wifi where you will edit the same file that the Wifi section tells you to modify


Then Section
Set A Static IP

To set a static IP you need to replace the
dhcp4: true
line in the network-config file with lines that specify the intended IP address of the pi as well as its default gateway and DNS server. You can do this for either the eth0 or wlan0 interface (or both). It is important that you get the indenting right for this work correctly

For example if you were planning to give the pi the address 192.168.1.23 in the 192.168.1.0/24 subnet with a default gateway of 192.168.1.1 and a DNS server of 192.168.1.53 then the following text would work.

    addresses:
      - 192.168.1.23/24
    gateway4: 192.168.1.1
    nameservers:
      addresses: [192.168.1.53]
1 Like

Wonderful, cheers @francis-turner :blush:

You should probably post the whole section starting at ethernets. I just tried my instructions and got the indenting wrong and thus no network.
ethernets:
eth0:
addresses:
- 192.168.101.212/24
gateway4: 192.168.101.1
nameservers:
addresses: [192.168.101.253]
optional: true

Gaaah. can’t get the indent to display in the comment. See my original comment whihc has it right

1 Like

put triple backticks ``` above and below the pasted text to keep your indendation intact …

1 Like

Maybe you could tell your users up front that headless will not work for WiFi – at least until you get that fixed?
Saying at the beginning that a headless installation is possible, then saying “it won’t work the first time, just type ‘sudo reboot’ and it will work the second time” sounds like a bad practical joke. Headless means no monitor and no keyboard, so one cannot “just type sudo reboot”. I’ve just wasted a couple hours of my time and I’m less than happy. I would prefer you not make other users unhappy.

Unfortunately the fix didn’t make it into groovy’s release (20.10) (or more precisely, the fix that did make it in wasn’t sufficient). However, a (sufficient) fix did make it into hirsute’s release (21.04), though too late for the focal .2 release.

In other words, headless does work for WiFi with the current (21.04) server release. The necessary changes have also been back-ported to focal, but as a first-time boot issue that won’t take effect until the next point-release in August when fresh images are made.

2 Likes

I already read that. And still, your first timer is likely to get the nice stable version of Ubuntu and if they’re doing headless wifi, they’ll run headlong into this issue and may waste considerable time trying to get it to work, or they may conclude that it’s not worth their time and try another distribution. I think it’s worthwhile being upfront with your users about limitations.

A post was split to a new topic: Image does not fill SD card

there is no SSH by default for 20 or 21 version, the ssh file in boot is ignored so no headless possible

Suggest updating the example eth0 address to a valid IP on the /24 subnet. i.e. 192.168.1.23

1 Like

put dd instructions for people who don’t want to use some other unnecessary program to copy data to a memory card

It’s very easy to set-up a Raspberry Pi to boot from USB. Can you add a section on copying the to a USB drive, or directly installing everything on a USB drive?