In this tutorial, we are going to learn how to install Flatpak on Fedora 35.
Flatpak is a utility for software deployment and package management for Linux. Flatpak offers a sandbox environment in which users can run application software in isolation from the rest of the system.
Flatpak can be used by all kinds of desktop environments and aims to be agnostic as possible regarding how applications are built.
Flatpak runtimes and applications are built as OCI images and are distributed with Fedora registry
Flatpaks are a new way of deploying applications.
Advantages of using Flatpaks on Fedora
- Applications can easily be updated without rebooting the system
- Applications can easily be installed on Fedora silverblue
- Flatpaks works along all supported Fedora versions
- Flatpaks can be run by all users running on other distributions.
- Have Fedora 35 workstation up and running
- User with sudo privileges
- Have basic knowlege of terminal commands
Install Flatpak on Fedora 35
1. Install updates
The first thing for any system is to update its repositories in order to make them up to date.
$ sudo dnf update -y
2. Install Flatpak dependencies
Flatpak needs some dependencies before you can run the installation. To install those dependencies, use the following command.
$ sudo dnf install fedmod
We will the following sample output
# Sample output Installed: fedmod-0.6.4-2.fc35.noarch gobject-introspection-1.70.0-1.fc35.x86_64 libmodulemd1-1.8.16-6.fc35.x86_64 libxslt-1.1.34-6.fc35.x86_64 python3-aiodns-3.0.0-2.fc35.noarch python3-aiohttp-3.7.4-3.fc35.x86_64 python3-async-timeout-3.0.1-14.fc35.noarch python3-chardet-4.0.0-4.fc35.noarch python3-click-8.0.1-3.fc35.noarch python3-click-completion-0.5.2-6.fc35.noarch python3-decorator-5.0.9-3.fc35.noarch python3-gobject-base-3.42.0-1.fc35.x86_64 python3-gssapi-1.6.14-2.fc35.x86_64 python3-koji-1.27.1-1.fc35.noarch python3-libmodulemd1-1.8.16-6.fc35.x86_64 python3-lxml-4.6.5-1.fc35.x86_64 python3-multidict-5.1.0-4.fc35.x86_64 python3-pycares-4.0.0-5.fc35.x86_64 python3-requests-gssapi-1.2.3-3.fc35.noarch python3-requests-toolbelt-0.9.1-15.fc35.noarch python3-shellingham-1.3.2-4.fc35.noarch python3-smartcols-0.3.0-14.fc35.x86_64 python3-solv-0.7.19-3.fc35.x86_64 python3-typing-extensions-126.96.36.199-4.fc35.noarch python3-yarl-1.6.3-5.fc35.x86_64
3. Install Flatpak on Fedora 35
Now we can install Flatpak
$ sudo dnf install flatpak-module-tools
Sample output will look like this
# Installed: ModemManager-glib-1.18.2-1.fc35.x86_64 abattis-cantarell-fonts-0.301-5.fc35.noarch adobe-source-code-pro-fonts-2.030.1.050-11.fc35.noarch alsa-lib-188.8.131.52-3.fc35.x86_64 avahi-glib-0.8-14.fc35.x86_64 avahi-libs-0.8-14.fc35.x86_64 bluez-libs-5.63-1.fc35.x86_64 bubblewrap-0.5.0-1.fc35.x86_64 cairo-1.17.4-4.fc35.x86_64 cairo-gobject-1.17.4-4.fc35.x86_64 dconf-0.40.0-5.fc35.x86_64 fdk-aac-free-2.0.0-7.fc35.x86_64 flac-libs-1.3.3-9.fc35.x86_64 flatpak-1.12.4-1.fc35.x86_64 flatpak-selinux-1.12.4-1.fc35.noarch flatpak-session-helper-1.12.4-1.fc35.x86_64 fontconfig-2.13.94-3.fc35.x86_64 fribidi-1.0.10-5.fc35.x86_64
Check the version of installed Flatpak
$ flatpak --version
4. Add user to mock group
Mock is a tool for a reproducible build of RPM packages. It is used by the Fedora build system to populate a chroot environment which is then used in building a source RPM.
To add the user into mock group use the following command
$ sudo usermod -a -G mock $USER
Restart your system for the changes to take effect.
5. Install Flatpak runtime environment
Flatpak runs as a container in the Fedora platform, therefore we are supposed to enable remote testing on our system.
Add remote testing
$ flatpak remote-add fedora-testing oci+https://registry.fedoraproject.org#testing
Enable remote testing
$ flatpak remote-modify --enable fedora-testing
To know if it’s working try the following command.
$ flatpak install fedora-testing org.fedoraproject.Platform/x86_64/f35
Looking for matches… Info: org.fedoraproject.Platform//f34 is end-of-life, with reason: Fedora 34 runtime is no longer supported. ID Branch Op Remote Download ID Branch Op Remote Download 1. [✓] org.fedoraproject.Platform f35 i fedora-testing 672.8 MB / 672.8 MB Installing… ████████████████████ 100% 112.1 MB/s 00:00
6. Enable Flathub
Flathub is an app repository in Flatpak. It’s like Dockerhub for docker images. So to install any app you want to use run the following command.
$ sudo wget https://flathub.org/repo/flathub.flatpakrepo
For some reason, the following command can work alone on GNOME and KDE Fedora installation. If it fails for some reason add Fathub remote manually with the following command.
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Install app with Flathub
Let’s look at an example of how to install an application using Flathub. Let’s install steam
$ flatpak install flathub com.valvesoftware.Steam
You will see the following
Looking for matches… Required runtime for com.valvesoftware.Steam/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/21.08) found in remote flathub Do you want to install it? [Y/n]: y com.valvesoftware.Steam permissions: ipc network pulseaudio wayland x11 devices bluetooth devel multiarch per-app-dev-shm file access  dbus access  system dbus access  tags   xdg-music:ro, xdg-pictures:ro, xdg-run/app/com.discordapp.Discord:create  org.freedesktop.Notifications, org.freedesktop.PowerManagement, org.freedesktop.ScreenSaver, org.gnome.SettingsDaemon.MediaKeys, org.kde.StatusNotifierWatcher  org.freedesktop.NetworkManager, org.freedesktop.UDisks2, org.freedesktop.UPower  proprietary ID Branch Op Remote Download ID Branch Op Remote Download 1. [✓] org.freedesktop.Platform.Compat.i386 21.08 i flathub 88.2 MB / 101.4 MB 2. [✓] org.freedesktop.Platform.GL.default 21.08 i flathub 130.9 MB / 131.2 MB 3. [✓] org.freedesktop.Platform.GL32.default 21.08 i flathub 109.0 MB / 138.5 MB 4. [✓] org.freedesktop.Platform.Locale 21.08 i flathub 17.7 kB / 325.8 MB 5. [✓] org.freedesktop.Platform.openh264 2.0 i flathub 1.5 MB / 1.5 MB 6. [✓] org.freedesktop.Platform 21.08 i flathub 154.4 MB / 199.6 MB 7. [✓] com.valvesoftware.Steam stable i flathub 12.6 MB / 13.8 MB Installing 7/7… ████████████████████ 100% 12.6 MB/s
To run steam do the following
$ flatpak run com.valvesoftware.Steam
We have successfully installed Flatpak on Fedora 35. To learn more about Flatpak, use its documentation. I hope you enjoyed and learned something new.