Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

flatpak

Install, update and run (mostly graphical) applications in a sandbox, from Flatpak remotes like Flathub.

Level
RHCSA exam
Group
Software packages
Needs root
For changes
Package
flatpak

What it does

Flatpak apps come with their own runtime, so they do not depend on the RPM packages of the system, and they run in a sandbox with limited access. That is good for desktop apps, not for server software.

Apps come from remotes (Flatpak repositories). Installs are system-wide (as root, --system, default) or per user (--user). App IDs look like org.gimp.GIMP.

How to write it

flatpak [OPTION]... COMMAND [ARGUMENT]...

Main parts

remote-add NAME URL
Add a remote (--if-not-exists).
remote-delete NAME
Remove a remote.
remote-modify NAME
Change a remote (enable, disable, priority).
remotes
List the remotes.
remote-ls [NAME]
List what a remote offers (--app, --updates).
remote-info NAME REF
Details of a remote app.
search TEXT
Search apps in the remotes.
install [REMOTE] REF
Install an app or runtime.
update [REF]
Update apps and runtimes.
uninstall REF
Remove an app (--unused = old runtimes).
list
Installed apps and runtimes (--app, --runtime).
info REF
Details of an installed app.
run APP
Start an app.
ps
Running sandboxes.
kill INSTANCE
Stop a running app.
override APP
Change the sandbox permissions of an app.
permissions
Show stored permissions.
history
Show past changes.
repair
Fix a broken installation.
mask, pin
Stop updates of a ref / keep a runtime.
config
Show or change settings (like languages).
make-current, enter, document-*, build*
Other and developer commands.

Options 19

Most used

--user
Work on the per-user installation.
--system
Work on the system installation (default).
--installation NAME
Work on another installation.
-y, --assumeyes
Answer yes.
--noninteractive
No questions, little output (scripts).
--if-not-exists
With remote-add: no error when it exists.
--app
With list/remote-ls/update: only apps.
--runtime
Only runtimes.
--columns=LIST
Choose output columns (like application,version).
--from FILE
Install from a .flatpakref file.
--reinstall
Reinstall if installed.
--or-update
With install: update if installed.
--no-deps
Do not install dependencies.
--unused
With uninstall: remove runtimes nothing uses.
--delete-data
With uninstall: also remove the app data.
-v, --verbose
More output.
--ostree-verbose
Debug output of OSTree.
--version
Show the version.
-h, --help
Show help.

Examples 11

$ run as a normal user# run as root (or with sudo)

  1. 1Install Flatpak

    dnf install -y flatpak

    On a desktop system it is often installed.

  2. 2Add the Flathub remote

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

    System-wide remote.

  3. 3Add the Red Hat remote

    flatpak remote-add --if-not-exists rhel https://flatpaks.redhat.io/rhel.flatpakrepo

    Apps built by Red Hat (needs a registered system / Red Hat login).

  4. 4List remotes and their apps

    flatpak remotes
    flatpak remote-ls flathub --app | head

    What can be installed.

  5. 5Search and install an app

    flatpak search gimp
    flatpak install -y flathub org.gimp.GIMP

    Runtimes come too.

  6. 6Install only for one user

    flatpak install --user -y flathub org.mozilla.firefox

    No root needed; only this user has it.

  7. 7Run, list and update

    flatpak run org.gimp.GIMP
    flatpak list --app
    flatpak update -y

    Updates all apps and runtimes.

  8. 8Remove an app and old runtimes

    flatpak uninstall -y org.gimp.GIMP
    flatpak uninstall --unused -y

    Frees disk space.

  9. 9Check the sandbox permissions (security)

    flatpak info --show-permissions org.mozilla.firefox

    Shows file system, network and device access.

  10. 10Take away home folder access

    flatpak override --nofilesystem=home org.mozilla.firefox

    Tighter sandbox.

  11. 11See running apps

    flatpak ps

    Instance, PID and app ID.

Watch out

  • Flatpak is for desktop apps. Install server software with dnf.
  • A user installation is not visible for other users.

Files

/var/lib/flatpak/
System installation.
~/.local/share/flatpak/
User installation.
~/.var/app/
App data of the user.

Exit codes

0 :: Done. 1 :: Error.

Full manual

This page explains the command in simple words. The original manual has every detail.

In your terminal: man flatpak