Ubuntu

How to Install and Use Flatpak on Ubuntu 22.04

Flatpak is a packaging tool that enables users to install and manage packages on Linux operating systems. All packages on Flatpak have individual repositories and don’t rely on a centralized party which makes it different from Snap Store. In addition, Flatpak also installs all the dependencies and libraries required for installing a software by itself thus it has advantage over apt installer as well.

In the following guide, you will learn how to install and use Flatpak on Ubuntu 22.04.

How to install and Use Flatpak on Ubuntu 22.04

Flatpak repository is already included in the Ubuntu 22.04 repository list, thus making the installation pretty simple and easier to follow. The below steps will let you install Flatpak on Ubuntu 22.04.

Step 1: Updating the Packages

First, ensure that Ubuntu packages are up to date and that the below command will be used for this purpose.

$ sudo apt update

Step 2: Installing Flatpak

After the update, you can install the Flatpak on Ubuntu 22.04 using the following command.

$ sudo apt install flatpak

Enter “Y” to continue the Flatpak installation.

This will install the Flatpak on Ubuntu 22.04 within a few minutes.

To check the Flatpak version, you can use the following command.

$ flatpak --version

This ensures the latest version of Flatpak is successfully installed.

How to use Flatpak on Ubuntu 22.04

After successfully installing Flatpak on Ubuntu 22.04, it’s now time to tell you how you can use this tool to download different packages or software.

First enable the Flathub (a popular destination for searching the application) using the following command.

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

Once the Flathub is enabled, you can then search the application through the following command.

$ flatpak search <Application_name>

The above command will help you in searching for the latest version of an application as it provides you the application ID with its version. The Application ID is crucial as without it you won’t be able to install software through Flatpak.

In our case, we are installing Telegram (messaging service) on Ubuntu 22.04 using Flatpak. So, the above search command will become as follows:

$ flatpak search telegram

To get a full  application ID, you can simply use the Flatpak installation command with the application name using the following syntax.

$ flatpak install <Application_name>

Just replace the “Application_name” with the name of the application you want to install. In our case, we are installing Telegram through Flatpak using the following command.

$ flatpak install telegram

When you run the above command, it will provide you with two application IDs and you have to pick one for installation.

Select according to your choice. In our case, we are picking the first telegram ID which is “app/org.telegram.desktop”.

Enter “Y” in the onward steps to begin the installation.

After a few minutes, application will be downloaded on Ubuntu using Flatpak.

To run the application from Flatpak, again you will need the application ID and the syntax is given below.

$ flatpak run <Application_ID>

In the above screenshot, we use telegram application ID to run it on Ubuntu.

In this way, you can install multiple applications with ease. However, you will need to ensure the application ID must be the same; as in our case, it’s “app/org/telegram.desktop“.

Uninstalling Application through Flatpak

To uninstall the application from Flatpak, you will again need to use the application ID in the following command.

$ flatpak uninstall <Application_ID>

To uninstall Telegram:

$ flatpak uninstall app/org.telegram.desktop

Conclusion

Flatpak is a complete next-generation technology used to build and manage packages on Linux operating systems. It provides you the freedom to install several applications quite easily. The above method will guide you on installing and using Flatpak on Ubuntu 22.04, making it easier for the users to install different applications through their IDs without worrying about dependencies and packages error.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.