Horje
How to Install and Use Flatpak on Linux

Flatpak, a package management system, is designed to build and distribute applications on Linux distributions. It operates independently from the host system in a sandboxed environment, making it distro-agnostic and ensuring a consistent user experience across various Linux distributions.

What is Flatpak

Flatpak is a community-driven initiative for distributing desktop applications across various Linux distributions. It provides a way to package applications and their dependencies into a single file that can be installed and run on any Linux distribution that supports Flatpak.

Developers can package applications with all dependencies included, making it easier to distribute and run applications across different Linux distributions.

Benefits of using Flatpak include:

  • Centralized a way of hosting and distributing applications but also allows decentralized hosting and distribution of packages.
  • Breakage in a Flatpak application will not risk the system from breaking as Flatpak applications and runtimes are contained to not interfere with the system altogether.
  • Flatpak applications run in sandboxed environments and have limited access to the host, increasing the security of the host machine.
  • Unlike Snaps, it is a community-driven initiative.

Steps to Install Flatpak on Linux

Debian

To install Flatpak on Debian 10 or newer, use the following command:

sudo apt install flatpak -y
Flatpak on Debian

Ubuntu

Ubuntu is Debian based distro, so commands are same as Debian. To install Flatpak on Ubuntu 18.10 or newer, run it in termianl:

sudo apt install flatpak -y
Flatpak on Ubuntu

With older Ubuntu versions, the recommended way to install Flatpak is official PPA. These are the commands:

sudo add-apt-repository ppa:flatpak/stable
sudo apt update
sudo apt install flatpak

Linux Mint

Flatpak is pre-installed from Linux Mint 18.3 “Sylvia”. If you are not sure whether it is installed or not, then use the following command:

sudo apt install flatpak

Red Hat

To install Flatpak on Red Hat Enterprise Linux Workstation 8 or newer, run the below command:

sudo yum install flatpak -y
Flatpak on Red Hat

Fedora

Flatpak is pre-installed in Fedora 24 and newer. If you are not sure if it is already installed or not in your machine, you can use the following command to install it:

sudo dnf install flatpak
Flatpak  in Fedora 24

OpenSUSE

To install Flatpak, use the command below:

sudo zypper install flatpak
Flatpak in OpenSuse

Arch Linux

To install Flatpak on Arch and Arch based distros like EndeavourOS and Manjaro, simply run:

sudo pacman -S flatpak
Flatpak on Arch

Manjaro

Flatpak is pre-installed in Manjaro 20 and higher. If not, use the following command:

sudo pacman -S flatpak

Add Flathub to Flatpak

Flathub is the official and centralized repository for Flatpak applications. It serves as a hub where developers can distribute their applications in a format that is compatible with multiple Linux distributions.

To add Flathub as a remote repository in Flatpak, use the following commad:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

After adding the Flathub repository, refresh the list of remotes to ensure the changes take effect:

flatpak update

Commands to use Flatpak

Installation

Go to Flathub website and search the application in the search bar.

Flathub website

In the application page, click on the down array in install button to open commands modal.

install button

Run the fist command to install the application and the second one to run it.

flatpak install flathub <application-id>
flatpak run <application-id-or-name>
 install flathub

Update packages

Use the following command to update all the applications:

flatpak update
Update packages

Then press Y to confirm.

To update specific application, use the following command:

flatpak update <application_name_or_id>

List applications

To list installed applications, use the following command:

flatpak list
List applications

Uninstall package

To uninstall package, use the following command:

flatpak uninstall <application_name_or_id>

Press Y after that.

uninstall package

Conclusion

Flatpak enabled developers to focus on development of application without being worried compatibility with different Linux distributions. In this article, we have learned about Flatpak, installation of Flatpak in Linux distributions, adding Flathub to Flatpak and commands to use Flatpak.

Install and Use Flatpak – FAQs

Where can I find Flatpak repositories?

Ans: The main repository for Flatpak applications is Flathub (https://flathub.org/).

Can Flatpak applications access files on my system?

Ans: Flatpak applications are sandboxed and have limited access to the host system. They need explicit permissions to access files and resources outside their sandbox.

How do I manage permissions for Flatpak applications?

Ans: You can manage permissions for Flatpak applications using commands like:

flatpak permission-show <app_id>

flatpak permission-reset <app_id>

flatpak permission-set <app_id> <device_name> <allow/deny>

How can I check of Flatpak is installed?

Ans: To check if Flatpak is installed on your Linux system, use the following command:

flatpak --version




Reffered: https://www.geeksforgeeks.org


Linux Unix

Related
How I use Cockpit for my Home&#039;s Linux Server Management How I use Cockpit for my Home&#039;s Linux Server Management
Check and Monitor Active GPU in Linux Check and Monitor Active GPU in Linux
Privileged access management (PAM) for linux and unix Privileged access management (PAM) for linux and unix
How to Set up a Wireless Network in Linux How to Set up a Wireless Network in Linux
What is GitLeaks and How to Use It? What is GitLeaks and How to Use It?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
18