Signup for our newsletter to get notified about sales and new products. Add any text here or remove it.
No products in the cart.
Raspberry Pi has been undoubtedly the way to go for inexpensive single-board computing. You can create Raspberry Pi projects for powering everything from robots to smart home devices.
When the Raspberry Pi 4 launched in 2019, the performance amazed the Raspberry Pi enthusiasts. A more powerful CPU, USB 3.0 support, native Gigabit Ethernet, plus the ability to output 4K video at 60 Hz on dual monitors are the major improvements. The intent was to pitch Raspberry Pi as an entry-level desktop computer.
More recently, the Raspberry Pi 4 offers an 8 GB RAM model, which is better not only as a desktop but also for hosting databases and servers.
There are many operating systems that can be installed on a Raspberry Pi. Apart from the official Raspberry Pi OS (previously known as Raspbian), we have covered installation of Ubuntu MATE on Raspberry Pi. And in this tutorial I will cover a step by step Arch Linux installation.
Arch Linux doesn’t support ARM architecture (used by devices like Raspberry Pi) officially. But there is a separate project called Arch Linux ARM that ports Arch Linux to ARM devices. It is available in both 32-bit & 64-bit format.
I am going to use it for getting Arch on Raspberry Pi.
You’ll need the following things for this tutorial:
Since the installation procedure is purely terminal-based, you should have intermediate knowledge of the Linux command line and you should be comfortable in using terminal.
When you insert you microSD card in your card reader, open the terminal, get root /sudo access and list the block devices to identify the card. The installation process needs to be done using root priviledges.
My block device is the mmcblk0, your device may be different.
Partition the SD card using fdisk command. Keep in mind to replace the device name with your sd card’s name.
At the fdisk prompt, the existing partitions have to be deleted and a new one should be created.
At this point, I will create the filesystem for the boot and root partition using mkfs command and then mount it. If in doubt about the partition names, list again the partitions as you did in the first step.
mount /dev/sdX1 boot
mount /dev/sdX2 root
Make sure that you have root access (otherwise the process may fail), and run the following commands (with sudo, if you are not root).
bsdtar -xpf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C root
Now move the boot files to the boot partition you had created:
mv root/boot/* boot
sed -i 's/mmcblk0/mmcblk1/g' root/etc/fstab
umount boot root
You might see “Failed to preserve ownership” errors. That’s normal because the boot partition isn’t owned by anyone.
If you need a 32-bit format for any reason, you can follow the commands below. The explanation stays the same as of the 64-bit format. Arch Linux ARM 32-bit
At this step Arch Linux is installed on the SD card, and the rest of the configurations will be done from the Raspberry pi.
You can either follow the rest of the tutorial, either directly on the Raspberry Pi by connecting a monitor and a keyboard set, or you can connect remotely to the Raspberry Pi via SSH (if you don’t have a spare monitor, you need to connect via Ethernet to your local network).
I will connect to my Raspberry Pi via SSH for this tutorial. To get the IP address of the Raspberry Pi, check the devices connected to your network and see which one is the Raspberry Pi.
Connect via WiFi
If an Ethernet connection is not an option, you can access your WiFi network after you login as root using the following command. Please note that you need a keyboard set and a monitor to initially connect on your WiFi.
Note: I am aware that wifi-menu is being discontinued in the original Arch Linux. For the moment, it works in Arch Linux ARM.
Once you find the IP address of your Raspberry pi, type the following command at your computer’s terminal using your IP address:
Please note the default user name is alarm and the default user password is alarm. The default root password is root.
To complete the installation process, you need to initialize the pacman keyring and populate the Arch Linux ARM package signing keys:
pacman-key --populate archlinuxarm
At this point the installation process has been completed and you can upgrade the system packages as root using the same pacman commands as you do with an x86 architecture machine.
If you want to reboot your Raspberry pi after a system upgrade, simply type reboot in the terminal and connect again via SSH.
To make the use of Arch Linux on a Raspberry Pi 4 more convenient I will show you a few tweaks/additions that you can do.
In order to change the default username you have to logoff and login as root only.
By default it is not permitted to directly login as root via SSH, but you can change that.
As a root user, edit the sshd_config file found in /etc/ssh/sshd_config:
Uncomment the PermitRootLogin and next to it type yes, or add the following line to the file. You can add it anywhere but it’s good practice to find the authentication block and add it there.
Save and exit the file, and restart the SSH server.
systemctl restart sshd
Now type exit twice, to exit root and exit the SSH remote connection.
To connect to your raspberry pi as root, use the root name instead the default username and your ip address.
Remember that the default root password is root.
To change the default username and password type the following commands at your terminal
usermod -l new_username old_username
usermod -d /home/new_username -m new_username
To change the default root password type the following command at your terminal
To be able to give sudo privileges to a user, you need to install the sudo package as a prerequisite.
pacman -S sudo
The configuration file for sudo is /etc/sudoers. It should always be edited with the visudo command.
Once you open the configuration file, add your username in a similar way as I do, preferably under the root user. Then save the file and exit.
To change system hostname on Systemd based distributions, you need to use hostnamectl command as shown:
hostnamectl set-hostname New_Hostname
Now type exit, to terminate the SSH session and login again with your new username, and your new user password.
Many users prefer Arch Linux or an Arch Linux based distribution for the large Arch User Repository. You can use the AUR packages on an ARM instruction set machine but, not all of them are compatible with this architecture.
To begin with, make sure that you have the git package and base-devel group installed.
sudo pacman -S git base-devel
You can now install whichever package from the AUR you like or via an AUR Helper in a similar manner which is a package in AUR too. My personal choice is yay, but you can install whichever you prefer.
git clone https://aur.archlinux.org/yay.git
As an Arch Linux user and RISC fan, the combination of Arch on a Raspberry Pi looks a possible scenario of my future desktop computer. An alternative solution, but with a preinstalled desktop environment could be the Manjaro ARM distribution.
For the time, I use my Raspberry Pi for non-desktop tasks and I’m well settled to Ubuntu Server which I find a really good choice for the Raspberry Pi. The almost negligible power consumption of the Raspberry Pi makes it an ideal server machine.
Are you interested about Raspberry Pi projects? Make sure you subscribe to our newsletter and leave your thoughts in the comments section.
Powered by BetterDocs
Username or email address *
Lost your password?