Flatpak is a universal system package, used for application virtualization, deployment, and mainly used for package management that almost works on all Linux environments. This application comes bundled with all other packages dependencies and libraries. Flatpak has an important feature, all applications work in a sandbox or work in an isolated environment. So, various versions of an application can run on a single system.
This article will explain to you the complete procedure of the installation of Flatpak on the Ubuntu 20.04 system through the command line. You can install Flatpak on Ubuntu 20.04 system in two different ways:
- Install Flatpak from the official Ubuntu repository
- Install Flatpak using the PPA Alexander Larsson repository. (The PPA repository gets you the latest Flatpak version on the Ubuntu system).
Let’s start the installation of Flatpak on the Ubuntu 20.04 system:
Method 1: Install Flatpak from Official Ubuntu Repository
Flatpak can be installed easily from the Ubuntu official repository by using the apt package manager. So, open the terminal application through the application search bar or press ‘Ctrl + Alt + t’ to open the command line window.
Now, update the system apt packages by using the below-mentioned command:
$ sudo apt update
The above command updates all packages, it helps you to install the latest version of an application on your system. However, issue the following terminal command as the root user to install Flatpak on Ubuntu 20.04 system:
$ sudo apt install Flatpak
Enter the root password. After that, the installation would start on your system. You will notice the confirmation prompt appears on the terminal window during the Flatpak installation. So, press ‘Y’ and then ‘Enter’ to confirm the installation process.
Once the Flatpak installation is completed, check the installed version by executing the following command:
$ flatpak –version
Method 2: Install Flatpak using the PPA Alexander Larsson repository
To install the latest version of the Flatpak, add the PPA repository to your system by running the following command:
$ sudo add-apt-repository ppa:alexlarsson/flatpak
Now, update the system packages repository and then, install Flatpak by executing the below-mentioned command:
$ sudo apt update
$ sudo apt install flatpak
Check the installed Flatpak version. You will notice that the latest Flatpak version is installed on your system:
$ Flatpak –version
Install Software by using the Flatpak
You can install any application through the Flatpak on your system. Follow the below-mentioned step to install software through Flatpak:
Step 1: Add Flathub repository
Add the Flathub repository by running the following terminal command:
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Now, update the repository as follows:
$ sudo apt update
Step 2: Search application Through Flatpak
To do this, search the application name by using the following syntax:
$ flatpak search [application_name]
For example, we want to search postman application through flatpak then, the following command use to search postman by using the flatpak software:
$ Flatpak search postman
Step 3: Install application through Flatpak
Install the postman through the Flatpak on your system. To do this, run the below-given command on the terminal:
$ flatpak install flathub [Application_ID]
The command will change into the following form:
$ flatpak install flathub com.getpostman.Postman
Or
$ flatpak install flathub postman
Step 4: Uninstall application through Flatpak
You can also uninstall the application through the flatpak:
$ flatpak uninstall [Application_ID]
$ flatpak uninstall com.getpostman.Postman
Uninstall or Remove Flatpak from Ubuntu 20.04
To remove the Flatpak from the Ubuntu system, type the following command:
$ sudo apt remove flatpak
To remove the PPA Alex Larsson repository, run the below-given command on the terminal:
$ sudo rm /etc/apt/sources.list.d/alexlarsson-ubuntu-flatpak-focal.list
Conclusion
We have executed various commands for Flatpak installation on Ubuntu 20.04 system article. We have shown how you can install an application through Flatpak software. We have also explained the two different removal processes of Flatpak. Now, using this universal software, you can access the latest applications on your system.