How to Install Flatpak on Linux

Endrit Qerreti

Endrit Qerreti

In this tutorial you will learn how to install Flatpak on various Linux distros.

What is Flatpak?

Flatpak is similar to snap, a tool that allows you to download and install apps that are isolated from the rest of system

Install Flatpak on Ubuntu/Debian

Step 1 - Install Flatpak

To install flatpak on Ubuntu you need to run the following command below

sudo apt install flatpak

The above command works on Ubuntu 18.10 or later versions, if you are using an older version of Ubuntu then you need to add the official Flatpak ppa to your system before installing flatpak

Step 2 - Add Flatpak PPA

1) Run the following command to add flatpak ppa to your system

sudo add-apt-repository ppa:alexlarsson/flatpak

2) Update your System

Once you have added the official ppa of flatpak into your system then you need to update your system with the command below

sudo apt update

3) Install flatpak

sudo apt install flatpak

Step 3 - Add Flathub Repository

Flathub is the app store that you'll need to download apps from, so to add it type the command below

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Step 4 - Reboot

Once you have finished installing flatpak and adding the ppa/flathub repository, you need to reboot your system.

reboot

Install Flatpak on Fedora

Type the command below in order to install flatpak on Fedora

sudo dnf install flatpak

Install Flatpak on OpenSuse

Run the command below to install flatpak on Opensuse

sudo zypper install flatpak

Install Flatpak on Arch

On Arch you can install flatpak via package manager pacman, simply run the command below and the downloading should start

sudo pacman -S flatpak

Install Flatpak on Linux Mint

sudo apt install flatpak

Install Flatpak on CentOS 7 Gnome

Flatpak is enabled by default on CentOS 7, so you don't need to install it but only to enable flathub, so all you need to do is download the flathub repo file

This is the official download link - https://flathub.org/repo/flathub.flatpakrepo

Once you have installed flatpak on your Linux distro, make sure to add the flathub's repository because this is the repository from where the apps you want to install will be downloaded.

Add Flathub Repository

Each distro has different installation steps, however, once you have installed flatpak, the command to add the flathub is the same for all distros, so make sure to run this command after you have installed flatpak on your favorite linux distro.

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

How to install an app from Flathub using Flatpak?

To install an app from flathub is easy, the right syntax looks like the example below

repo - is flathub repository in this case

app-name - the app name you are going to install

flatpak install [repo] [app-name]

For example: To Install Mozilla Firefox you need to run this command

flatpak install flathub org.mozilla.firefox

How to search for an app on flathub?

Search via Terminal

You can search directly in the terminal by using flatpak's search function

flatpak search firefox

This command will show all results based on our keyword 'firefox'

Note : Application ID is the app name that you need to type when installing an app

Search Via Web

If you are not fan of terminal and you want to search on the web, you can do so by going to Flathub's official website.

https://flathub.org/home

Simply type the app name you want to install on the search box and hit enter

On the app page you can also install the app by clicking to the install button, then all you need to do is run the downloaded file .flatpakref

The flatpakref looks like this

To install it simply double click on it

Conclusion

By now you should know how to install and use flatpak on different Linux Distros.