Flatpak
Overview
Flatpak is a free and open source package management system for building and distributing desktop applications on Linux independently from the host system in a sandboxed environment, which help to solve issues related to dependencies and make sure that users across different distros share the same experience.
Installation
Install flatpak package
Setup
User Level Setup (Recommended)
Add a user specific Flathub repository:
Automatically update flatpaks with Discover or Gnome Software
Solutions like Discover and Gnome Software can update automatically the flatpak applications, but if you don't use applications as such a valid option is to create a systemd unit and timer to handle this automatically for you.
Manual setup of the systemd unit and timer for automatic setup
To automatically update flatpaks, create the systemd unit service with the $USER that will be using flatpak:
Add the following content:
[Unit]
Description=Update user Flatpaks
[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak --user update -y
[Install]
WantedBy=default.target
Then create the timer:
Add the following content:
[Unit]
Description=Update user Flatpaks daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
To enable the service reload the systemd units and enable the timer:
$ systemctl --user daemon-reload
$ systemctl --user enable --now update-user-flatpaks.timer
System Level Setup
Add Repository
Add a system-wide Flathub repository:
Automatically update flatpaks with Discover or Gnome Software
Solutions like Discover and Gnome Software can update automatically the flatpak applications, but if you don't use applications as such a valid option is to create a systemd unit and timer to handle this automatically for you.
Manual setup of the systemd unit and timer for automatic setup
To automatically update flatpaks, create the systemd unit service sudo for a whole system setup:
Add the following content:
[Unit]
Description=Update system Flatpaks
[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak --system update -y
[Install]
WantedBy=default.target
Then create a timer:
Add the following content:
[Unit]
Description=Update system Flatpaks daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target
To enable the service reload the systemd units and enable the timer:
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now update-system-flatpaks.timer
Usage
Delete a repository
List repositories
To list all the added repositories use this command:
Installing a new app
To install a new flatpak app use the following
or by specifing the repository
or user-specific
Uninstalling an app
Find an app
Once you've configured a repository