This wiki was updated to MediaWiki 1.37. If you notice any issues, please report them to admin[at]opensuse.org

Flatpak

Jump to: navigation, search
Flatpak

Flatpak.jpg

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

Install flatpak package

# zypper in flatpak

Usage

Add a repository

You can add a repo using this syntax

flatpak remote-add --if-not-exists <repo> <link>

Add a system-wide Flathub repository:

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

Add a user specific Flathub repository:

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

don't forget to update after adding a new repository

flatpak update

Automatically update flatpaks

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.

Automatically update system level flatpaks

To automatically update flatpaks installed the system level with the root user create a systemd unit:

# nano /etc/systemd/system/update-system-flatpaks.service

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:

# nano /etc/systemd/system/update-system-flatpaks.timer

Add the following content:

[Unit]
Description=Update system Flatpaks daily

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target--- systemd/user

To enable the service reload the systemd units and enable the timer:

# systemctl daemon-reload
# systemctl enable --now update-system-flatpaks.timer

Automatically update user level flatpaks

To automatically update flatpaks installed the user level with the $USER user create a systemd unit:

$ nano $HOME/.config/systemd/user/update-user-flatpaks.service

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 a timer:

$ nano $HOME/.config/systemd/user/update-user-flatpaks.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

Delete a repository

flatpak remote-delete <repo>

List repositories

To list all the added repositories use this command:

flatpak remotes

Installing a new app

To install a new flatpak app use the following

flatpak install <name>

or by specifing the repository

flatpak install <repo> <name>

or user-specific

flatpak install --user <repo> <name>

Uninstalling an app

flatpak uninstall <name>

Find an app

Once you've configured a repository

flatpak search <name>

Updating a specific app

flatpak update <name>

List installed apps

flatpak list

See also

Related articles

External links