The number of Linux systems is not small, and creating an application that is compatible with all of them is difficult for developers. Thus, here Flatpak comes. It aims to install the same package on all popular Linux regardless of their code or binary. Without any conflict, it places all required binaries, libraries, configuration files, and other files in a directory usually a subdirectory of /var/lib/flatpak/app/
to run an application. Hence, a Flatpak application can therefore usually run on all Linux distributions with an installed Flatpak without any further adjustments.
Part of the basic concept of Flatpak is that every application needs a runtime environment (“Runtime” in the Flatpak context). A list of the Flatpak runtime environments can be found in its documentation. There are, for example, runtime environments for Gnome and KDE, which are of course correspondingly large. Several Flatpak applications can share the same runtime environment as long as the applications use the same version of the environment. If there is no runtime environment, it will be installed automatically. Several runtime environments in different versions can also be installed in parallel.
Here we will let you know the command to install Flatpak on AlmaLinux or Rocky Linux 8.
Steps to install Flatpak on AlmaLinux or Rocky 8
DNF update
The first thing we need to do is updating of the system packages along with refreshing repositories.
sudo dnf update
Install FlatPak on AlmaLinux/Rocky
The packages we need to set up Flatpak are already in the official repository of these RPM-based Linux distros, thus what we have to do is running an installation command using DNF or YUM package manager.
sudo dnf install flatpak
Add the Flathub repository
Flatpak is now on our system, however, we need to add its repository so that it could fetch the packages from Flathub to install on Almalinux or rocky you are using. For that use the command, given below:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Again run system update-
sudo dnf update
Restart your system
To properly integrate the Flatpak in the system’s path restart your Linux system.
sudo reboot
Install some Flatpak app
Now, let’s test it is working absolutely fine or not. For that here we are installing Spotify, you can install any other app available on the FlatHUB repo.
flatpak install flathub com.spotify.Client
To remove any installed app using it
flatpak remove application-name
(optional) To remove Flatpak run:
sudo dnf remove flatpak
To update
flatpak update