Flatpak
OSTree based application bundles management
License: LGPL-2.1
Web: https://flatpak.org/
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
sudo zypper install flatpak
Setup
User Level Setup (Recommended)
Add a user specific Flathub repository:
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak update
Automatically update flatpaks with KDE Discover or Gnome Software
Solutions like KDE Discover and Gnome Software can update automatically 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.
systemctl --user edit --full --force flatpak-user-update.service
Add the following content:
[Unit]
Description=Flatpak Automatic Update
Documentation=man:flatpak(1)
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak --user uninstall --unused -y --noninteractive ; /usr/bin/flatpak --user update -y --noninteractive ; /usr/bin/flatpak --user repair
Then create the timer:
systemctl --user edit --full --force flatpak-user-update.timer
Add the following content:
[Unit]
Description=Flatpak Automatic Update Trigger
Documentation=man:flatpak(1)
[Timer]
RandomizedDelaySec=10m
OnBootSec=2m
OnCalendar=*-*-* 4:00:00
Persistent=true
[Install]
WantedBy=timers.target
To enable the service reload the systemd units and enable the timer:
systemctl --user daemon-reload
and then
systemctl --user enable --now flatpak-user-update.timer
System Level Setup
Add Repository
Add a system-wide Flathub repository:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak update
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:
sudo systemctl edit --full --force flatpak-system-update.service
Add the following content:
[Unit]
Description=Flatpak Automatic Update
Documentation=man:flatpak(1)
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/flatpak --system uninstall --unused -y --noninteractive ; /usr/bin/flatpak --system update -y --noninteractive ; /usr/bin/flatpak --system repair
Then create a timer:
sudo systemctl edit --full --force flatpak-system-update.timer
Add the following content:
[Unit]
Description=Flatpak Automatic Update Trigger
Documentation=man:flatpak(1)
[Timer]
RandomizedDelaySec=10m
OnBootSec=2m
OnCalendar=*-*-* 4:00:00
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 flatpak-system-update.timer
Usage
Delete a repository
flatpak remote-delete <repo>
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