Skip to main content

Using Flatpak

Installing Flatpak Packaging Support

Before you start using Flatpak packages, you need to install the Flatpak support on your system.

Many Linux distributions like Pop!_OS, Linux Mint, Fedora, etc. come pre-configured with Flatpak so before you follow the given instructions, use the following command to check if Flatpak is already configured or not:

flatpak --version

If the above command gives you the installed version of Flatpak then you can skip the installation process. But for many users, it would give them an error saying "Command 'flatpak' not found":

command flatpak not found in Linux

So in this quick tutorial, I will walk you through the following:

  • Install Flatpak on Linux (covering every popular distro)
  • Setting up a Flatpak repository
📋
After installing Flatpak, make sure to follow the instructions to add the Flatpak repository on Linux. Steps are written at the end of this tutorial.

Install Flatpak on Ubuntu

You can install Flatpak on Ubuntu using the default package manager apt in the following manner:

sudo apt install flatpak

Install Flatpak on Fedora and other RHEL-based distros

Yes, I mentioned at the beginning of this tutorial that Flatpak is pre-installed on Fedora and other RHEL-based distros.

But there's a catch.

It is only applicable to the new releases and you still have to manually install Flatpak on older versions. To install Flatpak on Fedora and other RHEL-based distros, use the following command:

sudo yum install flatpak

Install Flatpak on openSUSE

To install Flatpak on openSUSE tumbleweed or leap, you can use the zypper package manager as shown here:

sudo zypper install flatpak

Install Flatpak on Arch Linux

This is my favorite one and there's a reason. Unlike with other Linux distributions where you have to set up a repository after installing the Flatpak package, Arch does not require setting up a repository.

So all you have to do is install the Flatpak package with the pacman and you're good to go:

sudo pacman -S flatpak

Install Flatpak on Gentoo

To install Flatpak on Gentoo, you first need to enable the ~amd64 keyword for the necessary packages. For that, execute the given commands one by one:

echo -e 'sys-apps/flatpak ~amd64
acct-user/flatpak ~amd64
acct-group/flatpak ~amd64
dev-util/ostree ~amd64' >> /etc/portage/package.accept_keywords/flatpak

Now you can install Flatpak using emerge:

emerge sys-apps/flatpak

Install Flatpak on Void

To install Flatpak on Void Linux, use the xbps-install command in the following manner:

sudo xbps-install -S flatpak

Install Flatpak on NixOS

To install Flatpak on NixOS, open the /etc/nixos/configuration.nix file using the following command:

sudo nano /etc/nixos/configuration.nix

Now, go to the end of the file by pressing Alt + / and paste the given line to install Flatpak on NixOS:

services.flatpak.enable = true;

Next, save changes and exit from the nano editor. To take effect from the changes you made, rebuild the NixOS:

sudo nixos-rebuild switch

Setting up Flatpak Repository

📋
Skip this part if you're an Arch Linux user.

Once you are done installing the Flatpak package on your computer, you need to set up a Flatpak repository.

To set up a Flatpak repository, all you have to do is execute the following command:

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

Now, log out and log back in to take the effect of the changes you made to your system.

Wrapping Up...

In this quick tutorial, I want through how you can install and setup Flatpak on various Linux distributions.

If you faced any issues in the installation process, leave us a comment and will come up with a solution ASAP.

Satoshi Nakamoto