Install Flatpak via Terminal on Debian 12

This guide intends to teach you to Install Flatpak via Terminal on Debian 12 Bookworm. Flatpak is a package manager software that allows you to install and manage an app without the need to worry about its dependencies and your Linux distros. It is a universal package. You can follow this guide to install the Flatpak package manager, enable Flathub, and see some examples of using Flatpak.

Steps To Install Flatpak via Terminal on Debian 12

Before you start, you must have access to your server as a non-root user with sudo privileges. For this purpose, you can follow this guide on Initial Server Setup with Debian 12 Bookworm.

Now follow the steps below to start your Flatpak installation.

Step 1 – Command To Install Flatpak Debian 12 Bookworm

First, you must run the system update with the following command:

sudo apt update

The Flatpak packages are available in most default Linux distribution repositories. So you can easily use the command below to install Flatpak:

sudo apt install flatpak -y

When your installation is completed, verify it by checking the Flatpak version:

flatpak --version
Output
Flatpak 1.14.4

Step 2 – Enable Flathub Platform on Debian 12

At this point, you must enable Flathub which is a platform used for searching the apps with Flatpak. To do this, you can run the command below:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Output
Note that the directories

'/var/lib/flatpak/exports/share'
'/root/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

Step 3 – Searching Applications with Flatpak

At this point, you can start to search apps with Flatpak. To search for a specific app, you can use the following syntax:

flatpak search <Application_name>

For example, we want to search for OpenJDK:

flatpak search openjdk

In your output, you will see:

Output
Name      Description              Application ID        Version  Branch Remotes
OpenJdk … OpenJdk 8 Sdk extension  …k.Extension.openjdk8          23.08  flathub
OpenJdk … OpenJdk 8 Sdk extension  …k.Extension.openjdk8          22.08  flathub
OpenJdk … OpenJdk 8 Sdk extension  …k.Extension.openjdk8          21.08  flathub
OpenJdk … OpenJdk 8 Sdk extension  …k.Extension.openjdk8          20.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk17          23.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk17          22.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk17          21.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk17          20.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk11          23.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk11          22.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk11          21.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk11          20.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk11          19.08  flathub
OpenJDK … The LTS (long term supp… ….Extension.openjdk11          18.08  flathub
OpenJDK … The latest version of t… …dk.Extension.openjdk 20.0.2+9 23.08  flathub
OpenJDK … The latest version of t… …dk.Extension.openjdk 20.0.2+9 22.08  flathub
OpenJDK … The latest version of t… …dk.Extension.openjdk          21.08  flathub
OpenJDK … The latest version of t… …dk.Extension.openjdk          20.08  flathub
OpenJDK … The latest version of t… …dk.Extension.openjdk          19.08  flathub
OpenJDK … The latest version of t… …dk.Extension.openjdk          18.08  flathub

Step 4 – Installing an Application with Flatpak

When you search for your desired app, you can easily install it with Flatpak without any dependencies on Debian 12. The syntax is as follows:

flatpak install <Application_name>

For example, we want to install the OpenJDK package:

flatpak install openjdk

It will be looking for the matches and you should choose which one to use:

Flatpak install a specific app

When your installation is completed, you will get the following output:

Output
        ID                                       Branch   Op  Remote   Download
        ID                                       Branch   Op  Remote   Download
 1. [✓] org.freedesktop.Sdk.Extension.openjdk8   21.08    i   flathub  112.9 MB / 115.2 MB

Installing… ████████████████████ 100%  28.2 MB/s  00:00

Step 5 – Uninstalling and Removing Applications with Flatpak

If you use Flatpak to install an app, you can easily uninstall it by using the following syntax:

flatpak uninstall APP-ID

For example, we use the APP ID of OpenJDK we have installed to uninstall it:

flatpak uninstall runtime/org.freedesktop.Sdk.Extension.openjdk8

Answer Yes to continue your uninstalling process.

Step 6 – Uninstall Flatpak from Debian 12 Bookworm

If you no longer want to use Flatpak on your Debian 12 server, you can easily remove it with the command below:

sudo apt autoremove flatpak -y

To get more information, you can visit the Flatpak documentation page.

Does Flathub work on Debian?

As you can see in this guide, you can use a single command to install Flatpak and enable Flathub to search for the apps on Debian,

Is Flatpak and FlatHub the same?

Flatpak is the tool used to install applications, and FlatHub is a repository that distributes the applications to Flatpak users. FlatHub is only one of many online repositories (called “remotes” in Flatpak) that can be queried for software to download and install in Flatpak.

Conclusion

At this point, you have learned to install Flatpak via terminal on Debian 12 Bookworm, enable the Flathub repository to search for the apps, and then, use Flatpak to install and manage the applications.

Hope you enjoy it. You may be interested in these articles:

2 Methods To Install Android Studio on Debian 12

Install Tor Browser on Debian 12 From Terminal

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!