Today, I tried installing Fedora on my Raspberry Pi, and I want to share information about it with you.
If you are used to Fedora on the desktop, you need to know that it’s also possible to install it on your Raspberry Pi. I will show you how in this post.
There is an official build of Fedora available for the Raspberry Pi device. It can be installed by downloading one of the image on the official website (Workstation, Server, Minimal or Spins) and flashing it to an SD card with a tool like Balena Etcher.
In this post, I’ll show you how to do this on your Raspberry Pi:
- In the first part, I’ll provide a short introduction to the Fedora project for those who are entirely new to this.
- Then I’ll show you how to install the minimal version, before installing any desktop interface. The Workstation version is a bit too slow, even for the Raspberry Pi 3B+.
- And finally, I’ll give you some useful commands, specific to Fedora, so you can start using it with confidence.
If you really want fast progress on Raspberry Pi, you can check my e-book here. It’s a 30-day challenge, where you learn one new thing each day until you become a Raspberry Pi expert. The first third of the book teaches you the basics, but the following chapters include projects you can try on your own.
Introduction about the Fedora Project
To begin, let’s start with a quick reminder about the Fedora Project for those who aren’t familiar with it
What is Fedora?
Fedora is a popular Linux distribution, based on RedHat, with 1.5 million users today.
Fedora exists in four main versions:
- Fedora Workstation: for desktop users, with a graphical interface and pre-installed software like LibreOffice or Firefox.
- Fedora Server: release dedicated to servers, with a short life cycle and tools for sysadmins.
- Fedora Minimal: almost the same as Server, but a bit smaller.
- Fedora Spins: custom builds to fit your needs (ex: KDE or MATE desktop environments).
Since Fedora’s beginning, we’ve seen a development cycle of one to two releases each year.
Fedora uses a simple version number: 1, 2, 3 … 29, 30, 31 and there is also a less public code name.
Fedora was created in 2003, as the open source alternative to RedHat.
RedHat has turned into a pay-to-use model, including a bundle with an operating system and professional support.
From this, Fedora was born to provide a free version of their software, with community support.
Today, RedHat sponsors the Fedora Project and Fedora is a trademark of RedHat.
There has been a partnership between both for a long time.
If you are new to Fedora, you’ll receive similar software and usage to other distributions like Debian or Ubuntu, as you can run most of the desktop environment on Fedora with any popular software.
But there are some changes you may have an issue with it.
Some commands are completely different and you’ll also note differences in package management or the file locations.
That’s why I’ll add this extra part to the installation guide: if you come from Ubuntu/Raspberry Pi OS, you’ll probably need it.
For very old Fedora users (like me), note that DNF (Dandified YUM) is now the default package manager, replacing YUM since version 22.
Commands are almost the same, but I’ll use it in this post rather than yum (still available).
Install Fedora Minimal on Raspberry Pi
About the Fedora Minimal version
The Minimal version of Fedora is similar to the Raspberry Pi OS Lite.
It’s a working Fedora with basic packages and only a command-line interface.
Depending on your Raspberry Pi model you might try another version, but for Raspberry Pi 3B+ and older I recommend starting with a minimal version (Minimal or Server) and install the packages you need above it.
I’ll show you how to install a desktop environment on it because the default GNOME isn’t the best for Raspberry Pi. For example, I had a load average of 5 and nearly full RAM, with no app running. If you start Firefox, it’s game over :).
On Raspberry Pi 4 and 400, you can try the Workstation version to see if it’s fast enough for you.
But if performances are important for you, and you don’t absolutely want the GNOME desktop environment, you can also try to build your own custom version (or try a Spins one directly).
By the way, I haven’t tried the Spins version, but it might be the easiest and fastest way to get something like LXDE or XFCE working really well on any Raspberry Pi model.
Anyway, I’ll show you first how to get the Minimal version working, and how to install a desktop environment on it.
Download the Fedora Minimal image
Fedora has a dedicated page for Raspberry Pi with download links and basic information.
Go to this page and download the Fedora Minimal version for your architecture.
Copy Fedora Minimal on your SD card
Once you have the image file, you can flash it on a SD card like you would for other systems:
- Download and install Etcher, if needed.
Etcher is a magic tool to create an SD card easily on any platform (Windows, macOS, Linux).
- Insert the SD card into your computer.
- Start Etcher.
- Configure the SD card settings:
On the left, click on “Select image” and browse to its location (you don’t need to extract it, Etcher will manage this).
Then select your SD card drive by clicking on the second button (it’s often automatic).
And finally, click on “Flash!” to start the SD creation.
- After a few seconds, the SD card will be ready to use.
Start Fedora Minimal
As with most distributions, there is nothing to do once the SD card is ready.
Insert it in your Raspberry Pi, and you can start the basic configuration process.
- On the first boot, Fedora Minimal allows you to directly customize the basic settings. For example, there is no default user (like for graphical installations).
- The first menu looks like this:
- At each step, you need to type a number corresponding to the menu above, or to use the other options to continue (“c”), quit (“q”) or refresh (“r”).
User creation and root password are almost mandatory before leaving.
- Type 1 if you need to change the default language settings.
- The system offers a subsection to configure it.
- I highly recommend starting here if you have another keyboard layout or come from another country.
- Type 2 for the time settings.
- Not very useful at this step, so you can do this later.
- Type 3 for the network configuration.
- Mainly if you absolutely need a static IP address or a specific hostname.
- Wi-Fi is not working at this step, I’ll show you how to configure it later.
- Type 4 for the root password.
- Yes, on Fedora you have a root user that is accessible directly.
- But you can also give administrator privileges to another user, and use sudo like on Raspberry Pi OS.
- And finally, type 5 for the first user creation.
- In this step, you need to choose the username and password for the first user.
- You can also give him administrator rights.
- A “strong” password is needed. I didn’t look at minimum requirements, but I needed 11 characters, a capital letter and numbers in mine to let the system allow it.
It will ask you again for a password if the one you use is too weak (no error message).
- Try to use a different password than root if possible:
- Then the configuration is complete:
- Type “c” to continue the boot process.
You’ll finally get the login prompt from Fedora.
Type your user name and password, and continue to the next step.
Enable SSH access
If you like to follow a tutorial from SSH access like me, I’ll explain what you need to do on this new Fedora system.
If you are not familiar with SSH, it’s secure remote access to your Raspberry Pi from your computer.
You can use Putty on Windows (download here), or a simple terminal on Linux with:
SSH is already installed by default on Fedora Minimal, you just need to start it with:
sudo systemctl start sshd
This way, you can now copy/paste the following commands to go faster.
If needed, you can find the current IP address of your Raspberry Pi with:
ip addr show
Expand the main partition size
As with a few other Raspberry Pi distributions, the main partition in the SD card takes only what’s necessary for the system.
If you use “df”, you’ll see that the root partition is already full.
So the first step before you can do anything else is to expand it to use the full SD card capacity:
- For most devices, the / partition is mmcblk0p3.
To be sure you can use “fdisk -l” to see the current partition list.
The following commands enlarge the 3rd partition of mmcblk0, but with a very specific device (maybe dual SD card or multi-boot?), replace this with your own values.
- Expand the main partition with this command:
sudo growpart /dev/mmcblk0 3
- Then grow the volume to the SD card size:
sudo resize2fs /dev/mmcblk0p3
- Reboot your system to apply changes:
- It’s ready!
Use Wi-Fi on Fedora Minimal
If you only use Wi-Fi on your Raspberry Pi, you need to configure it to get Internet access to continue this tutorial.
After some complex commands and driver installation tests, I found this which works directly:
- List the available SSID near the Raspberry, if not sure for the exact name:
nmcli device wifi list
- Connect to one of them:
sudo nmcli device wifi connect <SSID> – ask
- Enter the Wi-Fi password and you’re ready.
Update your system
As after any distribution installation, the first thing you need to do is update the whole system
As I said in the first section, Fedora uses DNF to manage packages.
It’s close to APT with small differences.
To update your system, simply type:
sudo dnf upgradeThere is no need to do dnf update before, as it’s just an alias of this one:
Confirm the installation with “y” and wait a few minutes depending on your connection speed :).
When you get the “Completed” message, you can reboot the system to apply all changes:
Install useful packages
From here you are ready to use the minimal version as you want.
You can look for packages name with:
dnf search <string>
And install them with:
dnf install <package>
Here is an example:
If needed, you can now install a desktop environment.
But for most projects, it isn’t mandatory and I don’t recommend doing it as it’ll slow down your Raspberry Pi.
You can skip the next part if the Minimal version is fine for you.
Install a desktop environment on Fedora Minimal
We’ll now see how to install a lightweight Fedora desktop environment.
Choose a good environment
As said in the introduction, the default Gnome Shell was terrible.
Even after installed on a Minimal version, I had a bad experience.
So if you really need a graphical interface, I recommend looking for a lightweight one.
After a little research and tests, I found that XFCE is good but LXDE is better.
If you like XFCE and already use it somewhere else, that’s fine.
But for the step-by-step tutorial, I’ll show you how to install LXDE, now replaced by LXQt.
I didn’t successfully install LXQt, whereas LXDE is working directly.
Install LXDE on Fedora Minimal
One powerful feature with DNF is the possibility to use the group install switch to install all dependencies at once.
A few groups exist in DNF, including most of the popular desktop environments.
- To install LXDE you just need to type:
sudo dnf groupinstall -y "LXDE Desktop"
- Set graphical interface as default with:
sudo systemctl set-default graphical.target
- And that’s it, nothing else to do.
You need to reboot to apply changes and start directly on the Desktop:
After the reboot you’ll get the login screen, looking like this:
And once logged, you are on the LXDE desktop and can begin using it normally.
And the desktop looks like this with default options and a few windows open:
You can click on the Fedora menu (bottom left) to start a new app.
Test other desktop environments
For other desktop environments, it’s the same installation process.
You just need to find the group name.
- The command I use is:
sudo dnf group list | grep "Desktop"
- You’ll get a list like this:
- Xfce Desktop (xfce-desktop-environment)
- LXDE Desktop (lxde-desktop-environment)
- LXQt Desktop (lxqt-desktop-environment)
- Cinnamon Desktop (cinnamon-desktop-environment)
- MATE Desktop (mate-desktop-environment)
- Sugar Desktop Environment (sugar-desktop-environment)
- Deepin Desktop (deepin-desktop-environment)
- Basic Desktop (basic-desktop-environment)
- Then use for example:
sudo dnf groupinstall -y "Xfce Desktop"to install it
- For your information, you can also use the name in brackets with @ but it’s often longer in this case :).
sudo dnf install -y @mate-desktop-environment
- Don’t forget to reboot after the installation.
The Gnome shell installation seems different (or I miss something?).
To install it, use:
sudo dnf install -y @base-x sudo dnf install -y gnome-shell sudo systemctl set-default graphical.target sudo reboot
You can also keep the desktop environment installed, and ask not to start it on boot.
To do this, you can use:
sudo systemctl set-default multi-user.target
Tips & commands for Fedora on Raspberry Pi
Finally, I’ll give you a few tips if you are used to Raspberry Pi OS and looking for basic stuff.
If you miss something in the configuration menu during the installation, here is how to change your settings now.
Date and timezone
As there is no raspi-config on Fedora, the best way to do this is to use commands.
You can use the “date” command but I find the timedatectl one, easier to understand:
- Display current settings:
- Change timezone:
sudo timedatectl set-timezone <VALUE>
sudo timedatectl set-timezone Europe/London
- Change date manually (not recommended):
sudo timedatectl set-time 15:00:00
sudo timedatectl set-time 2020-07-12
sudo timedatectl set-time 2020-07-12 15:00:00
For language and keyboard layout, there is a similar command: localectl
- Check the current settings:
- Change the default language:
sudo localectl set-locale LANG=<VALUE>
sudo localectl set-locale LANG=en_GB
- Change the keyboard layout:
sudo localectl set-keymap <VALUE>
sudo localectl set-keymap fr-azerty
Fedora comes with a direct possibility to use the root account.
You can use it with sudo, su, or directly log in the root account.
Sudo is the Debian/Raspberry Pi OS way to handle administrator privileges for a standard account.
When you need to run a system command, you have to add sudo at the beginning, like in the “Localization” section.
You probably already know how to use it.
Su is a way to switch to the root account from your standard account.
This also exists on Raspberry Pi OS, so I won’t be long with my explanation.
Here is just a simple example where I switch to root, change the date without sudo, and go back to my account:
Password: <root password>
root# timedatectl set-date YYYY-MM-DD
And finally, Fedora allows you to directly log into the root account with SSH.
This might be, at the same time, a convenient way to do a change on the Raspberry Pi, but also a security risk as everyone will try the root login when attacking an SSH prompt.
So it depends on your environment. At home, it’s probably fine. In a company you probably need to disable the direct access and use sudo or su to do the same thing.
The last basic settings you may need to change is the network configuration.
The network configuration files are located in this folder on Fedora: /etc/sysconfig/network-scripts/
You’ll find a file for each interface: ifcfg-eth0 and ifcfg-wlan0
Edit them to configure the network as you want.
To set a static IP:
Change eth0 by wlan0 if you are configuring a static IP for your wireless connection.
Finally, I want to give you all the DNF commands in one place, to be sure you have everything you need for a good start on Fedora.
DNF is the Fedora alternative to APT, and there are almost the same commands.
Here is the complete list:
- Search a new package name:
dnf search <VALUE>
dnf search myadmin
dnf search php | grep mongo
- Install a new package:
dnf install <PACKAGE>
dnf install php-mongodb
- Uninstall a package:
dnf remove <PACKAGE>
dnf remove php-mongodb
- Update your system:
(Fedora recommend stopping using the update alias)
- Remove temporary files:
- Remove unnecessary packages:
I can’t do a complete documentation about Fedora usage on Raspberry Pi here.
But you can check the official one here: docs.fedoraproject.org.
This will answer most of your questions.
Here it is for today, I hope you really enjoy this guide and try it on your own Raspberry Pi.
If you like Fedora on Raspberry Pi, I can do a couple more posts on the topic. Let me know in the comment section!
If you are just checking several new operating systems to leave Raspberry Pi OS, I recommend the reading of the CentOS installation guide. It’s also based on Red Hat, so there are many similar things, and it works even better.