Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

Hoofdstuk 13Naam in de cursus: Installing and Updating Applications by Using Flatpak

Install desktop apps with Flatpak

Flatpak installs desktop applications in their own box (a sandbox), with their own libraries (a runtime). The app does not change the base system, and it can be updated on its own. On RHEL you get Flatpak apps from the Red Hat Flatpak repository (shown in the Red Hat Ecosystem Catalog) or from other remotes like Flathub.

  • 6 Lessen
  • 3 Commando's

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

$ als gewone gebruiker# als root (of met sudo)

Vaardigheden in dit hoofdstuk

  • Desktop-apps installeren met Flatpak

13.1

Know when to use Flatpak

Use DNF for the system and server software. Use Flatpak for desktop apps that users need in a newer version or without touching the base system.

RPM / DNFFlatpak
ForSystem tools, services, librariesDesktop applications
LibrariesShared with the systemOwn runtime, kept apart
RightsFull access to the systemSandbox: only the rights the app asks for
UpdatesWith the system (dnf update)Per app (flatpak update)
Install as userNo, needs rootYes, with --user

13.2

Add the Red Hat Flatpak remote

A remote is a Flatpak repository. Add the Red Hat remote once, then log in to the Red Hat registry.

dnf install flatpak
flatpak remotes
flatpak remote-add --if-not-exists rhel https://flatpaks.redhat.io/rhel.flatpakrepo
podman login registry.redhat.io
Username: anna.admin
Password:
Login Succeeded!
flatpak remotes --show-details
  • The Red Hat apps are stored as container images in registry.redhat.io, so you log in with your Red Hat account (or a registry service account token for many machines).
  • The login of podman login is kept only until you log out. To keep it, copy $XDG_RUNTIME_DIR/containers/auth.json to ~/.config/flatpak/oci-auth.json. For all users the file is /etc/flatpak/oci-auth.json.

Optional: add Flathub, the big community remote.

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

Let op

Apps from Flathub are not built or supported by Red Hat. In a company, check the policy before you add other remotes.

13.3

Find and install an app

Search the remotes, then install the app by its application ID (a reverse domain name like org.mozilla.firefox).

flatpak search firefox
Name      Description          Application ID        Version  Branch  Remotes
Firefox   Fast, Private & Safe  org.mozilla.firefox   140.4.0  stable  rhel
flatpak install rhel org.mozilla.firefox
flatpak install --user flathub org.gnome.Calculator
flatpak list
flatpak list --app
flatpak info org.mozilla.firefox
InstallWhereWho can use it
system (default)/var/lib/flatpakAll users; needs root (or a polkit password prompt)
--user~/.local/share/flatpakOnly you; no root needed

The first install of an app also installs its runtime (for example the RHEL Flatpak runtime). Later apps with the same runtime install faster.

13.4

Run, update and remove apps

Start apps from the desktop menu or with flatpak run. Update all apps with one command.

flatpak run org.mozilla.firefox
flatpak ps
flatpak kill org.mozilla.firefox
flatpak update
flatpak update org.mozilla.firefox
flatpak uninstall org.mozilla.firefox
flatpak uninstall --unused
flatpak history

Op het werk

flatpak uninstall --unused removes runtimes that no app needs any more — often several hundred MiB.

13.5

Check the rights of an app

Every Flatpak app lists the rights it needs (files, network, devices). You can see and change them.

flatpak info --show-permissions org.mozilla.firefox
[Context]
shared=network;ipc;
sockets=x11;wayland;pulseaudio;
devices=all;
filesystems=xdg-download;
flatpak override --user --nofilesystem=home org.gnome.Calculator
flatpak override --user --show org.gnome.Calculator
flatpak override --user --reset org.gnome.Calculator

Onthoud

filesystems=xdg-download means the app may use only your Downloads folder — not your whole home folder. Fewer rights = less damage if the app has a security hole.

13.6

Use the graphical tool

In the GNOME desktop, the Software app shows Flatpak apps from all remotes, with buttons to install, update and remove.

  1. Open Activities → Software.
  2. Search for the app, click it, and check the Source (for example rhel).
  3. Click Install. Updates appear in the Updates tab.
gnome-software

Alle commando's in dit hoofdstuk