Wednesday, July 3, 2024
HomeOperating SystemsUbuntuHow to install and manage Flatpak applications on Linux

How to install and manage Flatpak applications on Linux

This guide covers everything you need to know on how to install and manage FlatPak applications. It begins with the basic introduction to Flatpak, features associated with Flatpak, the installation of Flatpak on Linux to the Flatpak command-line interface.

What is Flatpak?

As time goes, there is a shift from the Traditional package formats where applications are built for a specific Linux distribution. These package formats are offered by DNF, YUM, APT, Pacman e.t.c. The introduction of distribution independent package formats has been a relief to many users. Here, an application is bundled with all the required dependencies to install and run the application within a single package. Flatpak is a distribution-independent package format framework used to distribute desktop applications on Linux. This is the new method to use to install and run applications on any Linux distribution.

Features of Flatpak

  • Space for innovations – Flatpak facilitates distribution maintainers to focus on their goals to innovate their distribution.
  • Rootless install – no root access required to install it.
  • Stability – breakage in an application will not cause the system to break since the applications and their runtime are contained and do not interfere with the system.
  • Sandboxed applications – this is one of Flatpak’s main goal to increase the security of desktop systems by isolating applications from one another.
  • Universality – It allows applications to be installed and run on virtually any Linux distribution.
  • Full control over dependencies – it is easy to bundle your own libraries as part of your app
  • Future-proof builds – The applications in Flatpak continue to be compatible with new versions of Linux
  • An independent project – developed and maintained by an independent community.

Now having gone through the amazing features of Flatpak, you are now convinced this is an amazing framework to use when installing and running applications on Linux. This guide aims to demonstrate how to install and manage Flatpak applications on Linux.

Step 1 – Install Flatpak on Linux Systems

Now we will commence by installing Flatpak on Linux. Flatpak can be installed on any Linux system using the below methods:

Install Flatpak on Debian/Ubuntu

On Debian/Ubuntu 18.10 and later, Flatpak can be installed as below.

sudo apt update
sudo apt install flatpak

Dependency Tree:

Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  flatpak
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,284 kB of archives.
After this operation, 6,722 kB of additional disk space will be used.
Get:1 http://security.debian.org/debian-security bullseye-security/main amd64 flatpak amd64 1.10.5-0+deb11u1 [1,284 kB]
Fetched 1,284 kB in 0s (21.7 MB/s)
Selecting previously unselected package flatpak.
(Reading database ... 143053 files and directories currently installed.)
Preparing to unpack .../flatpak_1.10.5-0+deb11u1_amd64.deb ...
Unpacking flatpak (1.10.5-0+deb11u1) ...
Setting up flatpak (1.10.5-0+deb11u1) ...
Processing triggers for dbus (1.12.20-2) ...
Processing triggers for man-db (2.9.4-2) ...

But for older versions of Ubuntu, the recommended way to install Flatpak is by adding repositories and installing it from the added repo.

sudo add-apt-repository ppa:flatpak/stable
sudo apt update
sudo apt install flatpak

Install the Flatpak plugin for the software app that enables one to install applications without the need of the command line.

sudo apt install gnome-software-plugin-flatpak

Install Flatpak on Arch Linux/Manjaro

Installing Flatpak on Arch Linux is a straightforward process. You only need to run the command:

sudo pacman -Syy
sudo pacman -S flatpak

Install Flatpak on openSUSE

Flatpak is available in the default OpenSUSE repositories currently maintained by the OpenSUSE Tumbleweed and Leap versions.

Install Flatpak on OpenSUSE using Zypper as below.

sudo zypper install flatpak

Install Flatpak on CentOS/RHEL/Rocky Linux

Flatpak is available by default on CentOS 7 and newer versions when using GNOME. If not, you can get Flatpak installed on CentOS/RHEL/Rocky Linux using the command:

sudo yum install flatpak

Dependency Tree:

Dependencies resolved.
================================================================================
 Package                    Arch       Version              Repository     Size
================================================================================
Upgrading:
 flatpak                    x86_64     1.8.5-5.el8_5        appstream     1.6 M
 flatpak-selinux            noarch     1.8.5-5.el8_5        appstream      26 k
 flatpak-session-helper     x86_64     1.8.5-5.el8_5        appstream      74 k

Transaction Summary
================================================================================
Upgrade  3 Packages

Total download size: 1.7 M
Is this ok [y/N]: y

Step 2 – Reboot your system

After successfully installing Flatpak on your Linux system, reboot the system for the changes made to apply.

sudo reboot -i

Wait for the system to reboot then login and proceed to manage applications using flatpak.

Step 3 – Manage Flatpak applications on Linux

Flatpak applications are hosted on a repository with the popular repository being the FlatHub repository. Flathub has innumerable applications in broad categories that include audio & video, developer tools, utilities, graphics & photography e.t.c.

Now you need to enable the Flathub repository on your Linux system with the below command:

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

Verify if the repository has been installed as below.

flatpak remotes

Sample Output:

$ flatpak remotes
Name    Options
flathub system

From the output, the Flathub repository has been installed and we can now install and manage applications from Flatpak.

1. Install applications using Flatpak on Linux.

Once Flatpak has been installed and the Flathub repository enabled, installing an application on Linux is so easy.

First search for the application on Flatpak.

sudo flatpak search app-name

For example, searching for Skype will be as below.

sudo flatpak search skype

Sample Output:

How To Install and Manage Flatpak applications on

From the output, details are provided for the application. To install the application, the syntax is as below.

sudo flatpak install remotes Application-ID

For example, to install the skype client, the command will be.

sudo flatpak install flathub com.skype.Client

Proceed as below.

How To Install and Manage Flatpak applications on Linux 1

The application will be installed from the remote Flathub.

How To Install and Manage Flatpak applications on Linux 2

2. Run Flatpak Applications on Linux.

With the application installed, you can launch it from the App Menu or by using the command-line

flatpak run Application-ID

In this case, we will launch skype as below.

flatpak run com.skype.Client

The application will be launched as below.

How To Install and Manage Flatpak applications on Linux 3

3. Update and Uninstall Flatpak applications on Linux

You can list all the installed Flatpak applications with the below command:

$ flatpak list
Name             Application ID                  Version   Branch Installation
Skype            com.skype.Client                8.79.0.92 stable system
Freedesktop Pla… org.freedesktop.Platform        21.08.5   21.08  system
Mesa             …reedesktop.Platform.GL.default 21.2.5    21.08  system
openh264         ….freedesktop.Platform.openh264 2.1.0     2.0    system

Updating Flatpak applications can be done in one command as below.

$ flatpak update
Looking for updates…
Nothing to do.

To uninstall a Flatpak application, use the command:

flatpak uninstall Application-ID

For example, uninstalling skype, the command will be:

$ sudo flatpak uninstall com.skype.Client

        ID                     Branch       Op
 1.     com.skype.Client       stable       r

Proceed with these changes to the system installation? [Y/n]: y

Closing Thoughts

Now we can concur that distribution independent package managers i.e snap and Flatpak are a relief and have revolutionized package management in Linux. From these managers, Linux users are assured that the provided applications will run across any Linux distribution.

I hope this guide was significant to you. If you encountered problems with this guide, let us know in the comments.

See more:

Nicole Veronica Rubhabha
Nicole Veronica Rubhabha
A highly competent and organized individual DotNet developer with a track record of architecting and developing web client-server applications. Recognized as a personable, dedicated performer who demonstrates innovation, communication, and teamwork to ensure quality and timely project completion. Expertise in C#, ASP.Net, MVC, LINQ, EF 6, Web Services, SQL Server, MySql, Web development,
RELATED ARTICLES

Most Popular

Recent Comments