Getting Started with Flatpak on Ubuntu Linux: A Comprehensive Guide

How to get Flatpak on Ubuntu and get access to more apps than just Snaps and .debs

Flatpak is a powerful and popular technology for application deployment and software management on Linux systems. It is used to create platform-independent applications that run on many different Linux distributions, including Ubuntu. In this guide, we will explain what Flatpak is, why it is useful, and how to get started with it on Ubuntu Linux.

What is Flatpak?

Flatpak is a free and open-source application sandboxing and distribution system. It is designed to allow developers to create and distribute platform-independent applications that can run on any Linux distribution. Flatpak applications are distributed in the form of “bundles”, which are collections of files that contain the necessary code, libraries, and data to run the application. These bundles are then distributed via repositories, which are collections of bundles that users can access and install.

In addition to making applications platform-independent, Flatpak also provides security benefits. It isolates applications from the underlying system and each other, preventing applications from interfering with each other or the system. This makes it more secure than traditional software installation methods.

Benefits of using Flatpak

Flatpak is a great way to manage applications on Ubuntu Linux. It hasmany advantages over traditional software installation methods, including:

  • Platform independence: Flatpak applications can be run on any Linux distribution, so developers don’t have to worry about compatibility issues.
  • Security: Flatpak isolates applications from each other and the underlying system, preventing applications from interfering with each other or the system.
  • Reliability: Flatpak applications are distributed via repositories, so they are always up-to-date and reliable.
  • Convenience: Flatpak makes it easy to find, install, and manage applications.

Installing Flatpak on Ubuntu

To get started with Flatpak on Ubuntu, we will first need to install theFlatpak package. This can be done by running the following command in a terminal:

sudo apt install flatpak

Once the package is installed, we can add the Flathub repository to our system. Flathub is the main Flatpak repository and contains thousands of applications. To add Flathub, we will need to run the following command in a terminal:

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

Optional

After adding the Flathub repository, we can install the GNOME Software Center. This is the main graphical tool for managing Flatpak applications on Ubuntu. To install it, we will need to run the following command in a terminal:

sudo apt install gnome-software-plugin-flatpak

Using Flatpak with the command line

While the GNOME Software Center is a great tool for managing Flatpak applications, it is not the only way to do so. Flatpak also provides a powerful command-line interface for managing applications. To use Flatpak with the command line, we will need to open a terminal and run the following command:

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

This will add the Flathub repository to our system, and then we can use the following command to list all available applications:

flatpak --user list --app

How to find Flatpak applications

Once the Flathub repository has been added to our system, we can use the GNOME Software Center to find Flatpak applications. To do this, we need to open the software center, click the “Flatpak” tab, and then search for applications. We can also use the command line to find applications by running the following command:

flatpak search <application name>

Installing Flatpak apps

Once we have found the application we want to install, we can install it using the GNOME Software Center or the command line. To install an application using the software center, we will need to open the software center, click the “Flatpak” tab, select the application we want to install, and then click the “Install” button. To install an application using the command line, we will need to run the following command:

flatpak --user install <application name>

Flatpak remote repositories

Flatpak applications are distributed via remote repositories, which are collections of bundles that can be accessed and installed by users. Flathub is the main Flatpak repository, but there are also many other repositories available. To add a new repository, we will need to run the following command in a terminal:

flatpak --user remote-add <repository name> <repository URL>

or

sudo flatpak -remote-add <repository name> <repository URL>

Managing installed apps

Once an application has been installed, we can then manage it using the GNOME Software Center or the command line. To manage an application using the software center, we will need to open the software center, click the “Flatpak” tab, select the application we want to manage, and then click the “Manage” button. To manage an application using the command line, we will need to use the following command:

flatpak list --app

This will list all installed applications, and then we can use the following command to manage an application:

flatpak info <application name>

Common Flatpak commands

Here are some of the most common Flatpak commands that can be used to manage applications:

  • flatpak list --app: List all installed applications.
  • flatpak info <application name>: Get information about an installed application.
  • flatpak install <application name>: Install an application.
  • flatpak uninstall <application name>: Uninstall an application.
  • flatpak update: Update all installed applications.
  • flatpak --user remote-add <repository name> <repository URL>: Add a remote repository.

Troubleshooting Flatpak

If you encounter any problems while using Flatpak, there are a few common solutions that may help. The first solution is to check if the application is up to date. If it is not, you can update it by running the following command in a terminal:

flatpak --user update <application name>

If that does not work, you can try reinstalling the application by running the following command:

flatpak --user uninstall <application name>

flatpak --user install <application name>

If that also does not work, you can try removing and reinstalling the application from a different repository by running the following command:

flatpak --user uninstall <application name>

flatpak --user remote-add <repository name> <repository URL>

flatpak --user install <application name>

Conclusion

Flatpak is a powerful and popular technology for application deployment and software management on Linux systems. It is designed to allow developers to create and distribute platform-independent applications that can run on any Linux distribution. In this comprehensive guide, we have explained what Flatpak is, why it is useful, and how to get started with it on Ubuntu Linux. We have also discussed some common commands and solutions for troubleshooting Flatpak. Following this guide, you should have everything you need to start with Flatpak on Ubuntu Linux.

We hope you found this guide on starting Flatpak on Ubuntu Linux useful.

If you enjoyed this article, why not check out our other articles on Linux? We have a wide range of topics covered.

Final notes

In this article we often used the --user switch with flatpak. This allows you to interact with flatpak at user level instead than at system level. By doing so, all the apps you install are only available for your own user. If you want the apps to be available system-wide, you need to explicitly use --system and you’ll have to run most of the flatpak’s commands via sudo.

Diego Zaccariotto
Diego Zaccariotto
Head of Customer Support - Team Leader EMEA | Service Operations Management, Change & Transformation

I’m a Senior Manager and IT professional with 25+ years of experience, a background in system administration, and an MBA.