Flatpak is the package manager that holds required libraries and dependent packages of the application inside one bundle supported by Red Hat. The goal is to achieve a single application that runs over multiple distributions without causing any package error.
Flathub is the repository of the flatpak where you can find all the applications available to install using flatpak. Now you may hear about snapd or snap packages backed by canonical, which work the same way flatpak works.
So, the difference between them is that flatpak is supported by more distribution than the snapd out of the box. The main reason behind this canonical has been found guilty of collecting user data for a personal benefit that breaks the open-source oath.
So, today we will learn how to install and use flatpak to find and install packages from flathub.
Table of Contents
Install Flatpak on Ubuntu
The excellent news is flatpak is available with the system repository of Debian distributions such as Ubuntu. You do not require to add any extra PPA. Use the below method to install it on your system.
First of all, it is always a best practice to update your system repository before installing any packages. You can update your system repository using the apt below command.
$ sudo apt update
Once your system repository is fetched with the latest application version information, use the below command to install flatpak in your system using the apt package manager.
$ sudo apt install flatpak
Add Flathub Repository
After the installation is completed, flatpak is successfully installed on your system. But we are not done here. To fetch and install the flatpak applications from the flathub from the terminal, you need to add the flathub repository.
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Finding for an application in Flatpak using terminal
After adding the above repository, you can find a flatpak application from the terminal using the below command.
$ flatpak search vlc
Right now, I’m searching for vlc, but you can replace it with another application name. Below is the behavior of the above command.
From above, you can see the list of all the applications related to vlc available in flathub. But from all those information, we need to focus on the “Application ID” to install that specific application using the flatpak command.
Installing application using Flatpak command
Take the “Application ID” of the application you want to install and pass it with the flatpak command below.
$ flatpak install org.videolan.VLC
After executing the above command, Yes/No will prompt multiple times. Type “y” and press enter to start the installation process.
After the installation is done, you can use the same “Application ID” to run the application (ex: vlc), as shown below.
$ flaptak run org.videolan.VLC
Below is the behavior of the above command.
As you can see, after executing the command, VLC has started running.
Innovative tech mind with 12 years of experience working as a computer programmer, web developer, and security researcher. Capable of working with a variety of technology and software solutions, and managing databases.