How to Install and Use Flatpak on Linux

In Linux, there are many avenues for installing a software package. You can use the package managers such as APT for Debian-based distributions and YUM for RHEL-based distributions. If the packages are not available in the official repositories, you can use the available PPAs ( For Debian distributions ) or install them using DEB or RPM packages. If you are not a fan of using the terminal, the Software Center can give you a much easier way of installing applications. If everything fails, you still have an option of building from source.

Be that as it may, a few challenges exist. The software center may not always have the application you are looking for and installing from PPAs may yield errors or compatibility issues. Additionally, building from source requires a higher level of expertise and is not a beginner-friendly way for newcomers to Linux.

In light of such challenges, a universal way of installing packages comes highly recommended in order to save time and avoid errors arising from compatibility issues. Canonical was the first to implement such an idea in the form of snap packages. Snaps are cross-distribution, containerized, and dependency-free software packages that simplify the installation of software applications.

Along with snaps, came flatpak, which is yet another universal packaging system.

Flatpaks

Written in C, a flatpak is a package management utility that allows users to install and run applications in a sandboxed or isolated environment. Just like snaps, flatpak aims at simplifying the management of software packages across various distributions. A single flatpak can be installed in any Linux distribution that supports Flatpaks without any modification.

How to Install Flatpak in Linux Distributions

In this guide, we focus on how you can install Flatpak and use it across various Linux distributions. Installing Flatpak is a 2-step procedure. First, you need to install Flatpak using your distribution’s package manager and later add the Flatpak repository ( Flathub ) from where applications will be installed.

Install Flatpak on Ubuntu and Mint

By default, Flatpak is supported on Ubuntu 18.04 and Mint 19.3 and later versions. You can confirm this by running the command:

$ sudo apt install flatpak
Install Flatpak in Ubuntu
Install Flatpak in Ubuntu

Install Flatpak on Debian and Debian-based Distros

For other Debian-based distributions such as Zorin, Elementary, and other distros, add the PPA shown and execute the command below:

$ sudo add-apt-repository ppa:alexlarsson/flatpak 
$ sudo apt update 
$ sudo apt install flatpak

Install Flatpak on RedHat and Fedora

For Fedora and RHEL/CentOS 8 run the command.

$ sudo dnf install flatpak

For earlier versions, RHEL/CentOS 7 use the yum package manager to install flatpak.

$ sudo yum install flatpak

Install Flatpak on OpenSUSE

To enable Flatpak on OpenSUSE invoke the command:

$ sudo zypper install flatpak

Install Flatpak on ArchLinux / Manjaro

Finally, to enable Flatpak on Arch Linux and its flavors, invoke the command:

$ sudo pacman -S flatpak

Once Flatpak is installed, the next step will be to enable Flatpak’s repository from where applications will be downloaded.

How to Add Flathub Repository in Linux

The next step will be to add Flatpak’s repository from where we will download and install applications. Here. we are adding Flathub since it’s the most popular and widely used repository.

To add Flathub to your system. run the command below.

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Adding Flathub Repository
Adding Flathub Repository

How to Use Flatpak in Linux

Before installing an application from the repository, you can search for its availability on Flathub using the syntax:

$ flatpak search application name

For example, to search Flathub for Spotify, run the command:

$ flatpak search spotify

The results will give you the Application ID, Version, Branch, Remotes, and a brief description of the software application.

Search Apps in Flathub
Search Apps in Flathub

To install the application from the repository, use the syntax:

$ flatpak install [remotes] [Application ID]

In this case, to install Spotify, run the command

$ flatpak install flathub com.spotify.Client
Install Apps from Flathub
Install Apps from Flathub

To run a flatpak application, execute the command:

$ flatpak run [Application ID]

For example,

$ flatpak run com.spotify.Client

In my case, this had the effect of launching the Spotify application.

Run Flatpak Application
Run Flatpak Application

To list the flatpak packages residing on your system, run the command:

$ flatpak list
List Flatpak Applications
List Flatpak Applications

To uninstall an application, use the syntax:

$ flatpak uninstall [Application ID]

For example, to remove Spotify, run:

$ flatpak uninstall com.spotify.Client

To update all flatpak packages, run:

$ flatpak update

In my case, all flatpaks were up to date, so no changes were made.

Update Flatpak Applications
Update Flatpak Applications

Finally, to check the version of flatpak you are using, execute:

$ flatpak --version
Check Flatpak Version
Check Flatpak Version
Conclusion

Flatpak goes a long way in providing access to additional software for your system. This is made possible by the Flathub repository which contains a huge collection of flatpak applications.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

James Kiarie
This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

1 Comment

Leave a Reply
  1. “The software center may not always have the application you are looking for”.

    I run antiX as my daily driver. I just used Synaptic Package Manager to access the antiX official repositories. I am presented with a list of well over 59,000 available packages that have been vetted and approved by the antiX development team. PPAs, AURs, and other private repositories probably contain packages that are not in the official distro repositories. However, I don’t think anybody can vouch for the quality of packages contained in those private repositories. Who knows how malware-ridden the packages in private repositories are.

    There is a possibility that Flatpacks, AppImages, and Snaps also contain packages that are not in official distro repositories. However, the official distro repositories contain many packages that have yet to make it into these three “universal” packaging systems.

    The “universal” packaging systems claim as an advantage over Package Managers the fact that they deliver complete applications that include all dependencies. When I install a package using Synaptic, it also pulls in and installs all the necessary dependencies. AFAIAC, the “universal” package systems have no advantage over Synaptic.

    BTW – how can Flatpack, AppImage, and Snap be called “universal” if there are not compatible with each other? “Universal” means ‘understood by all’. They are not understood by each other. Snap and Flatpack are being used by the companies that developed them (Canonical and Red Hat respectively) to dominate and monopolize the package installation field.

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.