As you may know, Flatpak is a modern application distribution system for Linux, designed to make the software available for all the Linux systems where it can be installed.
Unlike traditional package management systems tied to specific Linux distributions, Flatpak provides a sandboxed environment where applications can run securely and independently of the underlying system libraries. While the Apt package manager relies on the libraries already present in the OS, Flatpak packages ship all the required libraries embedded in the package (so require more disk space, but are not OS-specific).
This approach ensures consistency, reduces dependency conflicts, and enhances security by isolating applications from the core system. Flatpak is especially popular for providing access to the latest software versions and bridging gaps between different Linux ecosystems.
Flatpak applications are hosted in repositories called remotes, with Flathub being the most prominent and widely used repository. By adopting Flatpak, developers can ensure their applications are accessible to a broader audience without needing to package them separately for each Linux distribution.
For users, Flatpak offers a straightforward way to manage applications, keep them up-to-date, and maintain system stability.
0. How to install and configure Flatpak on Ubuntu, Linux Mint, Debian and derivative systems:
sudo apt update
sudo apt install flatpak
How that flatpak is installed, the first thing we need to do, in order to use it, is to add a remote (repository). The most popular flatpak repository is flathub.
1. Add a New Remote (Repository)
In order to add a remote (repository), we need to use the below command:
flatpak remote-add [name] [url]
In our case, this is the command for adding Flathub:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

As you may notice, no output is provided after this command is executed (because of the –if-not-exists argument).
2. Install a Flatpak Package
In the below example, we will be installing Calibre, an open-source ebook management tool.
The command syntax is the following:
flatpak install [remote] [application_ID]
To install calibre, we need to use the below command:
flatpak install flathub calibre
This installs Calibre from the Flathub repository.

3. Search for Flatpak Packages
Another useful command is to know how to search for flatpak applications. This searches only inside the remotes (repositories) that we already have. In our case, inside Flathub.
Command syntax:
flatpak search [keyword]
For example, let’s search for GIMP:
flatpak search gimp
Next, if we needed, we could install gimp with flatpak install org.gimp.GIMP.

4. List Installed Packages
In many cases, it’s useful to know how to see list all the flatpak packages installed on the system.
The command is the following:
flatpak list
This displays all the Flatpak applications installed on your system along with their details.

5. Run an Installed Flatpak Application
There are cases when you install apps directly via Flatpak, but you need to logoff and log back on, in order to be able to find them with search. To avoid this, you can run the flatpak apps via the terminal.
Command syntax:
flatpak run [application]
As we already know how to use flatpak list, we will now run calibre directly via the flatpak package:
Command syntax:
flatpak run application_ID

In our case:
flatpak run com.calibre_ebook.calibre
6. Update Flatpak packages
To update all the packages that were installed via flatpak, you need to use the following:
flatpak update

Or, you can update only a specific flatpak package with the below command.
Command syntax:
flatpak update application_ID
The below command updates qBittorrent (but now, there isn’t any update available):
flatpak update org.qbittorrent.qBittorrent

7. Uninstall/Remove a Flatpak Package
The Command Syntax for removing or uninstalling a package is the below one:
flatpak uninstall [application]
For example, the below command removes the Norka editor (only the application, the custom user files will not be deleted):
flatpak uninstall Norka

But there are cases when we also want to remove the configuration files associated with some package, not just the software itself:
In this case, we need to use the –delete-data argument. Command syntax:
flatpak uninstall --remove-data [application]
To remove calibre and everything associated with it, we run the below command:
flatpak uninstall --remove-data calibre

8. List Remote Flatpak Repositories
To see all the available flatpak repos, you need to run the below command.
flatpak remotes
I only have flathub added, that is why you don’t see more than that.

9. Check Flatpak Package Information
Sometimes, you might need to find out more information about an installed flatpak application.
Command syntax:
flatpak info [application]
In this example, I am looking for information about calibre
flatpak info com.calibre_ebook.calibre

10. Check The Flatpak History
To see what has been installed and uninstalled via Flatpak, use the below command.
flatpak history

Conclusion
Flatpak simplifies application management on Linux, and mastering these commands can significantly enhance your experience. Whether installing, updating, or troubleshooting, these commands have you covered.
Pingback: 10 Basic APT Commands Every Ubuntu User Should Know - GeekvaterDoesLinux
Pingback: How To Change The Hostname Without Restart On Ubuntu 24.10 and Ubuntu 24.04 - GeekvaterDoesLinux
Pingback: 10 Basic APT Commands For Beginners - GeekvaterDoesLinux