Installing the Raspberry Pi OS on an SD Card from Arch Linux
Last Update: Jul 5, 2024
I wrote a book! Check out A Quick Guide to Coding with AI.
Become a super programmer!
Learn how to use Generative AI coding tools as a force multiplier for your career.
So you just got a fancy new Raspberry Pi and want to set it up and get it running. There are several ways to do this, and there are many instructions for folks using Windows, Mac, or Ubuntu.
Lately, I’ve been using the RPI Imager. There aren’t any instructions on the official website for Arch Linux, but it isn’t much different to install and adds some cool options, as we’ll see in this article. I’ll also show you the old “dd” method.
So grab your SD card, and let’s get started.
Verifying your SD Card
I have a brand new SD card for this project, but that doesn’t matter much. I’ve plugged it into my laptop, and now let’s verify it exists and that it’s working. Arch Linux usually mounts these to /dev/sda. You can search to see how/where it’s mounted by typing in
sudo fdisk -l
This will show you a nice list.
You can also type
lsblk
To show your mounted drives as well. Again, it appears to be /dev/sda1.
If you want, you can format /dev/sda1
sudo umount /dev/sda*
and use mkfs
to format the card. If you want to format it for Windows, you can also use
sudo mkfs.fat -F 32 /dev/sda1
And this will create a new FAT32 partition:
This is all optional, I’m starting with a blank card, so it doesn’t matter much. Let’s put an OS on this thing.
Installing from an Image
If you check out this page, you will see quite a few options for installing an OS on the Raspberry Pi. There are many more images out there, including Arch Linux for your Raspberry Pi!
The one I am interested in is Raspberry PI OS Lite:
- Raspberry Pi OS Lite
- Release date: July 4th 2024
- System: 64-bit
- Kernel version: 6.6
- Debian version: 12 (bookworm)
- Size: 432MB
I’ll click that download it, and now I have this .xz image in my downloads.
We need to convert 2024-07-04-raspios-bookworm-arm64-lite.img.xz
into an image.
Let’s install some xz utils:
sudo pacman -S xz
Then, extract it:
unxz 2024-07-04-raspios-bookworm-arm64-lite.img.xz
And you should now see an img file:
Next, we’ll use dd to copy the raw image onto our SD Card:
sudo dd if=2024-07-04-raspios-bookworm-arm64-lite.img of=/dev/sda bs=4M conv=fsync status=progress
And it’s good to go!
Pop out the card and put it in your Raspberry Pi.
If you prefer a graphical interface, that’s available too. Let’s try it out!
Easier way with the RPI Imager
Not everyone is fond of the command line, even Arch Linux users. However, we also have the RPI Imager available in Arch.
sudo pacman -S rpi-imager
It’s just a single command, giving you the same imager you find on Ubuntu, Windows, and Mac.
First, you choose your device. In my case, it’s a Raspberry Pi 5:
Then under images, select Raspberry Pi OS (other)
From there we can select Raspberry Pi OS Lite:
And finally, choose our storage:
and select the SD Card:
And it’s ready to burn.
Here is where it gets awesome.
You can edit your OS settings, set a username and password, and set your Wi-Fi settings.
This is great because, without a monitor on your Raspberry Pi, you have to connect to your network with an ethernet cable, hunt down your IP address, log in with the default login, and set up your Wifi.
Make sure to enable SSH so you can get into the Pi:
With this window using the RPI Imager, you can set your Wifi up and configure it to connect before you even boot the first time. It’s a great addition.
Now you can pop in your card, power up your Pi and you’re ready to go!
Summary
In this tutorial, we showed two different ways to install an OS for your Raspberry Pi using an Arch Linux Desktop.
While I’ve done the dd/command line images for years, I’ve come to appreciate the RPI Imager because of the customization step at the end. You can go in and make changes to the filesystem on your SD card after it’s written, but this is so easy and simple. It’s the way I’ve been doing it for a while now.
I hope this has helped you out, and If you have any questions or comments feel free to reach out.