Post

Installing Flatpak Applications on Linux Distributions

Installing Flatpak Applications on Linux Distributions

Flatpak is a packaging format specifically designed to enable applications to run seamlessly on any Linux distribution, be it Debian, Fedora, OpenSUSE, Arch, or other family of Linux distributions.

The initial Flatpak setup process varies for each family of Linux distributions. However, once set up, the procedure for downloading, installing, and using Flatpak apps is consistent across all distributions.

This post illustrates the process for Debian/Ubuntu-based Linux distributions. For other distributions, please refer to https://flathub.org/setup.

Installing flatpak

Installing Flatpak on Debian/Ubuntu is straightforward. Simply use the ‘apt’ command to install Flatpak.

1
sudo apt update && sudo apt install flatpak

Installing software manager plugin

Install the plugin to search for Flatpak apps directly from the Software Center.

For those using the KDE desktop environment, use the following command:

1
sudo apt install plasma-discover-backend-flatpak

For those using the GNOME desktop environment, use the following command:

1
sudo apt install gnome-software-plugin-flatpak

Add flatpak app repositories

Adding the Flatpak repositories is crucial because they host Flatpak apps, allowing you to download apps from these repositories. You can add multiple Flatpak repositories and choose which one to use when downloading packages.

The most popular flatpak repository out there is Flathub. To add Flathub to your list of Flatpak repositories, use this command:

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

Besides Flathub, there are other popular repositories as well. Please find below a table of popular Flatpak repositories and the corresponding commands to add them:

Flatpak repoCommand to add
kdeappsflatpak remote-add –if-not-exists kdeapps https://distribute.kde.org/kdeapps.flatpakrepo
fedoraflatpak remote-add –if-not-exists fedora oci+https://registry.fedoraproject.org
gnome-nightlyflatpak remote-add –if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo
appcenterflatpak remote-add –if-not-exists –user appcenter https://flatpak.elementary.io/repo.flatpakrepo

Finding, installing and unistalling the flatpak app

After adding the repositories, the most convenient way to discover and install Flatpak apps is through your system’s software center. For KDE, use ‘Discover,’ and for GNOME, use ‘GNOME Software Center.’

Simply search for your desired app, and once the results are displayed, click on the ‘Install’ button in the app list. You can easily identify Flatpak packages by the Flatpak symbol located at the top right corner of the list items. You can uninstall a Flatpak package in the same manner.

Using the flatpak cli

You can also utilize a command-line interface (CLI) for Flatpak, enabling you to perform all of the aforementioned tasks and a wide range of additional functions.

Here are a few essential Flatpak commands:

See the list of added flatpak remote repositories

1
flatpak remotes --columns=name,url

Add the flatpak remote repository

See Add Flatpak repostories section.

Remove the flatpak remote repository

1
flatpak remote-delete <remote_name>

An ex: flatpak remote-delete flathub

List available software packages on the remote

1
flatpak remote-ls <remote_name>

Search for an app in the repositories:

1
flatpak search <search_pattern> --columns=name,application,description

As an example, let’s locate the Microsoft Teams package and install it. Execute the following command to search for teams using Flatpak:

1
flatpak search teams --columns=name,application,description

The output may be extensive, but we have successfully identified the accurate entry for Microsoft Teams:

Name                     Application ID                                Description
teams-for-linux          com.github.IsmaelMartinez.teams_for_linux    Unofficial Microsoft Teams client for Linux using Electron

Please make a note of the Application ID provided above. We will be using this value in the subsequent commands. For teams-for-linux, the Application ID is com.github.IsmaelMartinez.teams_for_linux.

Install the app

1
flatpak install <Application ID>

To install the Microsoft Teams:

1
flatpak install com.github.IsmaelMartinez.teams_for_linux

Run the application

1
flatpak run <Application ID>

See installed applications

1
flatpak list

Uninstall the applicaiton

1
flatpak uninstall <Application ID>

Update the packages to latest versions

1
flatpak update

Please refer Flatpak Command Line Reference for full list of commands.

This post is licensed under CC BY 4.0 by the author.