The Flattak command in Linux: applications in container

Introduction to Flatpak

Flatpak is a Linux application distribution and execution system that uses containers to isolate host system software. This technology allows programmes to be installed and implemented independently of distribution, avoiding conflict of units and ensuring uniform experience in different environments.

How does Flatpak work?

Flatpak packs an application along with all its libraries and necessary resources inside a container. Each container is based on a runtime, which provides a common environment (such as the GNOME or KDE runtime). When the user runs a Flatpak application, the system mounts the container and isolates its processes, files and devices from the rest of the system.

Advantages of using Flatpak

  • Independence of distribution: the same package works in Ubuntu, Fedora, Arch, etc.
  • Improved security: containers limit access to host resources through permits and portals.
  • Updates without breaking the system: applications are updated within your own container without affecting other installations.
  • Test facility: users can install beta or development versions without risk.

Installation and basic use of the flatpak command

To start using Flatpak you need to install the service and add a repository. In most distributions the package is called flatpak. After installing it, the Flathub repository is added, which houses most of the available applications.

sudo apt install flatpak   # En Debian/Ubuntu
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Once configured, search and install an application is as simple as:

flatpak search gi
flatpak install flathub org.gimp.GIMP

To run it:

flatpak run org.gimp.GIMP

Application and Runtime Management

Flatpak offers commands for listing, updating and deleting applications. For example:

  • flatpak listdisplays installed applications.
  • flatpak updateupdates all applications and runtimes.
  • flatpak uninstall org.gimp.GIMPremoves a specific application.

The runtimes, which are the base layers of the containers, are also managed with similar commands:

flatpak list --runtime
flatpak update --runtime

Integration with the desktop and portals

Flatpak does not completely track the application; instead, it uses controlled portals that allow secure access to system functions such as clipboard, printing, access to USB drives and file selection dialogues. These portals are managed by the desktop environment (e.g. XDG Desktop Portal) and ensure that the application can only perform actions that the user has explicitly authorized.

Thanks to this architecture, Flatpak applications can be perfectly integrated with GNOME, KDE or other environments, showing notifications, using themes and accessing markers without breaking the security model.

Limitations and considerations

Although Flatpak solves many problems, he has some limitations that are worth knowing. The download size may be greater than that of a native package due to the inclusion of libraries within the runtime, although the use of shared runtimes mitigates this effect. In addition, certain applications that require deep access to hardware, such as specialist printer drivers or virtualization tools, may require additional permissions or may not be available in Flatpak format.

Another aspect to consider is the version of the runtime: if an application depends on a very new runtime, it may not work on older distributions without updating that runtime. Fortunately, Flathub offers frequently updated runtimes, and the Flathub update command is in charge of keeping them up to date.

Conclusion

Flatpak has been consolidated as a practical solution for distributing Linux applications safely and universally. Its container-based approach simplifies the life of both developers and end users, eliminating the feared problems of dependencies and offering a consistent environment regardless of distribution. If you have not yet tried it, install Flatpak and explore Flathub is an excellent first step towards a more modern and flexible Linux experience.

This work is under aCreative Commons License Attribution 4.0 International for Francesc Roig francesc @ vivaldi.net.

EnglishenEnglishEnglish