Linux newbies get their money's worth as they can install packages while saving time and effort. Canonical, the parent company of Ubuntu, was the first to implement Snaps, cross-distribution, dependency-free software.
With Snap came Flatpak, another universal packaging system written in C. It is considered a package management utility and enables a user to install and run applications in an isolated environment.
Like Snap, Flatpak aims to make software management easier across Linux distributions. Here are some common terminologies to be aware of:
- Flatpak: This is a system used to build, distribute, and run sandboxed desktop applications on Linux.
- running time: Runtimes are also known as platforms because they function as integrated platforms to provide basic utilities necessary for a Flatpak application to function.
- Flatpak application: These are applications that a user can use the. can install Flatpak Command on your computer.
Benefits of Using Flatpak
- universality: Flatpak as a utility service manager enables a user to virtually install and run applications on almost any Linux desktop. This includes all non-GNU distributions, read-only operating systems, systemd-free distributions, or other architectures.
- Innovation friendly: Flatpak sponsors distribution maintainers to help developers focus on their innovation goals.
- stability: Errors within an application do not lead to an interruption of the system. This is because Flatpak runtimes are included and do not affect the functioning of the system.
- Rootless installation: You do not need elevated rights when installing a Flatpak application / runtime.
- Sandbox applications: One of Flatpak's primary goals is to improve system security by isolating applications from one another. Applications run in a sandbox and run in separate silos.
Install Flatpak on Linux distributions
Depending on the Linux distribution used, there are different options for installing Flatpak.
The Flatpak installation is a two-step process. The first step involves installing Flatpak through a package manager. The second step is to add the Flatpak repository, Flathub, from which you can install various applications.
Here's how you can install the package on different Linux distributions:
On Ubuntu and Mint
By default, Flatpak supports Ubuntu 18.04, Mint 19.3 and their newer versions. You can install the package on Ubuntu and Linux Mint using APT:
sudo apt install flatpak
On Debian and Debian-based distributions
To install Flatpak on Debian-based distributions like Elementary and Zorin, you need to add a PPA to your system before downloading the package:
sudo add-apt-repository ppa: alexlarsson / flatpak
sudo apt update
sudo apt install flatpak
You can also use the commands above to install Flatpak on Ubuntu.
Via Red Hat and Fedora
Run this command to install on RHEL-based distributions like Fedora and CentOS:
sudo dnf install flatpak
Alternatively, you can also use the YUM package manager:
sudo yum install flatpak
Issue the following command to install Flatpak on OpenSUSE:
sudo zypper install flatpak
On ArchLinux / Manjaro
Finally, run the following command to install the package on Arch Linux and its derivative distributions:
sudo pacman -S flatpak
Adding the Flathub repository on Linux
The next step is to add Flatpak's repository, Flathub, so that you can download and install applications from one of the most popular and widely used repositories.
Run this command to add the repository on Linux:
flatpak remote-add –if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
How to use Flatpak on Linux
Using Flatpak is pretty similar to using other package managers on Linux. You can use the Flatpak command line tool to find and install applications in the Flathub repository.
Search applications on Flathub
Before installing the applications, you can check whether a particular application is available in the repository. The default format for this command is:
Flatpak search application name
As an example, let's search for Spotify and install it if it is available.
Flatpak search Spotify
The resulting values indicate the application ID, version, branch, and remotes along with a description of the software.
Install packages with Flatpak
The basic syntax for installing applications with Flatpak is:
flatpak install remotes applicationID
For example, to install Spotify you can use:
Install flatpak flathub com.spotify.Client
Start an application
Use the following command format to start an application:
flatpak run applicationID
flatpak run com.spotify.Client
This will eventually launch the Spotify application on your system.
List installed Flatpak packages
Let's go one step further. To get a list of all the Flatpak packages installed on your system:
Update installed packages
To update Flatpak packages in your system, do the following:
If all packages are already up to date, there will be no new changes after running the above command.
Uninstall software with Flatpak
If you've installed an application and no longer want to keep it, you can use the. uninstall successfully uninstall Method. The standard syntax of the command is:
Uninstall Flatpak Application ID
Since we just installed Spotify, try uninstalling the application by typing:
Uninstall flatpak com.spotify.Client
Activate the GNOME repository
Just like Flathub, the GNOME repository contains all of the core GNOME applications. The central repository itself has two versions: stable and nightly.
Add the GNOME stable repository
To use wget to download the GPG keys for the repository:
Add the GNOME Flatpak repository to your system by doing Remote add:
sudo flatpak remote-add –gpg-import = gnome-sdk.gpg –if-not-exists gnome-apps https://sdk.gnome.org/repo-apps/
To install the nightly version instead, run the following commands:
sudo flatpak remote-add –gpg-import = nightly.gpg –if-not-exists gnome-nightly-apps https://sdk.gnome.org/nightly/repo-apps/
Listing remote repositories
To list all configured remote repositories:
Flatpak remote controls
The above command lists the repositories that you have added to your system. It also shows whether the repository is a system-wide installation or is only intended for a few users.
Deleting a Flatpak Repository
The basic syntax for deleting a repository is:
sudo flatpak remote-delete remote-name
…Where Remote name is the name of the remote repository.
For example, to remove the Flathub repository from your system:
sudo flatpak remote-flathub delete
Repair Flatpak installation
Use the repair Command to repair Flatpak installation on your system:
repair sudo flatpak
The command will take a while to complete, so be patient and wait for it to complete.
Kill a Flatpak Trial
To kill a Flatpak process, first check which processes are running:
sudo flatpak ps
To end a process:
sudo flatpak kill applicationID
How to check if the system finished the process successfully:
sudo flatpak ps
Make the most of Flatpak's commandspa
As a beginner, you will likely find yourself overwhelmed by the various terminologies, jargon, and myriad commands available in Linux distributions. However, Flatpak is here to make your life easier by allowing you to install applications safely and securely.
If you are just starting out, it is best to slowly and steadily explore the various features while understanding the various nuances available in the distributions. If you don't want to bother with the command line at all, head over to Snap and Snap Store to install packages on Linux.
Everything you need to know about Snap and Snap Store
Overwhelmed with the steep learning curve of command line package managers? Get started with Snap and Snap Store today.
About the author
(3 articles published)
By Wini Bhalla
Subscribe to our newsletter
Subscribe to our newsletter for tech tips, reviews, free e-books, and exclusive offers!
One more step …!
Please confirm your email address in the email we just sent you.