Flatpak is a package manager that is available for installation on CentOS Linux and all other major Linux distros. Flatpak offers CentOS users an alternative to the official repos and default
dnf package manager as a source of software installation. Many applications available in Flatpak currently do not reside in official CentOS repos, making this a big benefit of installing Flatpak.
To use Flatpak on CentOS, we simply need to install the program, add the repos that contain the flatpak packages you wish to install, and then search for and install the packages. Flatpak will also let us manage and update the apps that we install. Flatpak works the same across all Linux distros, so you will only need to learn the command syntax once. The applications in Flatpak are also distribution independent.
In this tutorial, you will see how to install Flatpak package manager on CentOS Linux. Then, we will take you through some basic usage of Flatpak so you can get started with adding repositories and installing custom software of your choice.
In this tutorial you will learn:
- How to install Flatpak on CentOS
- How to search for a package in Flatpak
- How to install a package with Flatpak
|Category||Requirements, Conventions or Software Version Used|
|Software||Flatpak package manager|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
Install Flatpak on CentOS step by step instructions
Follow the step by step instructions below to install Flatpak on CentOS, and get started with using the package manager to search for and install packages, or “flatpaks” on your system.
Flatpak is installed by default on CentOS, ever since version 7. Even if you already have the package manager installed, you can still follow along with the steps below to make sure your installed version of Flatpak is up to date, and then add the FlatHub repository to start installing apps.
- Installation of Flatpak on CentOS is very simple. Just open up a command line terminal and run the following command:
$ sudo dnf install flatpak
- Next, you will need to enable one or more Flatpak repositories (referred to as “remotes” in Flatpak lingo). The biggest and best repository would be FlatHub. Enable it by executing the following command:
$ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- In order for the changes to take full effect, you will need to restart your system before using Flatpak:
- Once your system boots back up, we are ready to install some applications. There are multiple ways to search for applications to install. One method is to pull up the FlatHub website in your web browser and find something you wish to install.
Once you identify the app you want to install, just click the ‘Install’ button in your browser.
- Another way to search for an application would be to use the
flatpak searchcommand such as in the example below where we search for the ‘gimp’ application. This allows us to stay in our terminal instead of opening a web browser.
$ flatpak search gimp
- After identifying the program to install, use the
flatpak installcommand to complete installation.
$ sudo flatpak install flathub org.gimp.GIMP
The syntax is as follows:
$ sudo flatpak install [repository] [com].[company].[app]
- If you want to launch the installed application from terminal:
$ flatpak run org.gimp.GIMP
- You can update all of your installed applications with:
$ sudo flatpak update
- If, later on, you decide to remove an application, use the following command syntax. In this case, we will remove the GIMP program that we installed earlier.
$ sudo flatpak uninstall org.gimp.GIMP
- To get a full list of all of your installed flatpaks, run:
$ flatpak list
And to get a list of applications only:
$ flatpak list --app
In this tutorial, we saw how to install Flatpak on a CentOS Linux system. We also learned how to use Flatpak to add a software repository, install an application, update all installed apps, remove apps, and list the apps that are installed via Flatpak. Users love Flatpak because it is easy to install and run applications, and its built in sandboxing improves stability and security.