How to use Flatpak? Step-By-Step Guide

Flatpak is a framework for creating desktop packages in many Linux distributions. It has been developed by users with extensive history of working with the Linux computer device and runs as an unbiased open-source project. Flatpak’s strength lies in its up-to-date approach to software software delivery. It removes traditional constraints and provides a simple answer for computer programs, regardless of the programming language they use, the hardware they use, or the frameworks they use. This flexibility guarantees that builders can use Flatpak without questioning compatibility problems.

Steps To Install of Flatpak

To install the Flatpak into your system follow these steps:

Step 1: Update system packages with the following command.

sudo apt update && upgrade

Step 2: Install Flatpak with the following command

sudo apt install flatpak

Step 3: Install Flatpak support for GNOME Software with the following command.

sudo apt install gnome-software-plugin-flatpak

And that’s it you have successfully installed the flatpak for your system and ready to install and manage softwares and packages on it.

Steps To Install and use Applications in Flatpak

All the apps retrieved or provided by flatpak are actually hosted on Flathub which is remote repository for applications distributed by flapak.

So to install the apps you need to add this remote repository of flathub using this command:

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

Now you can download and install any application using flatpak . Suppose you wanted to install VSCode (Visual Studio code) for your linux system, You can do it by following command:

flatpak install flathub com.visualstudio.code

Note: “to get this command , visit Flathub webpage and search software you want to install you’ll get command on installation description button”

Run the installed application using this command:

flatpak run com.visualstudio.code

Uninstalling or Removing Software Packages from Flapak

To uninstall or remove any software from your system by using flatpak use following command:

sudo flatpak uninstall (Name of package/ app want to remove)

Suppose you want to remove the VsCode application from your system you can do this :

sudo flatpak uninstall com.visualstudio.code

Note: You have to use same package name that you used while installation process of that package.

Updating / Upgrading Flatpak Applications

To keep your application updated in flatpak it provides update functionality by following command:

sudo flatpak update org.ppsspp.PPSSPP

Flatpak Permissions and Sandboxing

One of the main goals of Flatpack is to increase the security of desktop systems by isolating applications from each other. This is achieved using sandboxing and means that, by default, applications running Flatpack have very limited access to the host environment. this includes:

  • No access to any host files except runtime, app, ~/.var/app/$FLATPAK_ID, and $XDG_RUNTIME_DIR/app/$FLATPAK_ID. Only the latter two are writable
  • There is no access to the network
  • No access to any device nodes (other than /dev/null, etc.).
  • There is no access to processes outside the sandbox.

Creating Custom Flatpak Builds

We know that flapak provides both services for retrieving and hosting application and softwares so we can also create our customs builds and applications using it and deploy it on flathub for providing those builds to user publicly.

We have created an sample application build on Flatpak which displays Text when it is run using flatpak.

Note: To create your own custom application builds you can visit the official webpage of flatpak Where all the detailed information about building and deploying application is provided thoroughly

Conclusion

As we’ve learned in this article, Flatpack has dramatically changed the landscape of desktop application distribution on Linux, providing a unified and efficient framework for both developers and users. We have covered important aspects of Flatpack, from installation and basic usage to storage and application management. Additionally, we’ve tried to update your apps, handle licensing and sandboxing for increased security, and custom Flatpack builds.

Flatpak – FAQs

What is Flatpak and what are its benefits?

The installation process for Flatpak varies depending on your Linux distribution. Generally, you can add the Flathub repository (a popular source for Flatpak applications) and install the flatpak package using your distribution’s package manager.

How do I update Flatpak applications?

Updating Flatpak applications is similar to installing them. You can use the following command in your terminal:

flatpak update

This command will update all installed Flatpak applications and their dependencies.

How do I uninstall Flatpak applications?

To uninstall a Flatpak application, use the following command in your terminal:

flatpak uninstall <application-name>

Replace <application-name> with the name of the application you want to remove.