Installing and Removing
Flatpak Packages

Install and remove Flatpak software packages

CIS126RH | RHEL System Administration 1
Mesa Community College

With a Flatpak remote configured, the next step is managing individual applications — finding the right package by its application ID, installing it system-wide or for a single user, verifying the result, updating applications independently of the OS, and cleanly removing software when it is no longer needed. This module builds directly on the previous remote configuration module and is tested on the RHCSA exam.

Learning Objectives

  1. Find Flatpak applications by name and ID — Use flatpak search and flatpak remote-ls to identify the correct application ID before installing
  2. Install Flatpak applications — Use flatpak install with system and user scope, and install from .flatpakref files
  3. Query and verify installed applications — Use flatpak list and flatpak info to confirm installation and inspect application details
  4. Update and remove Flatpak applications — Use flatpak update and flatpak uninstall to maintain and clean up the application set

Understanding Application IDs

Every Flatpak application has a globally unique application ID in reverse-domain-name format. This ID is required for install, run, info, and uninstall commands.

Application Application ID Breakdown
Firefox org.mozilla.firefox org = org, mozilla = publisher, firefox = app name
LibreOffice org.libreoffice.LibreOffice The app name component is capitalised as in the project name
GIMP org.gimp.GIMP All-caps project names stay all-caps in the ID
VLC org.videolan.VLC Publisher domain reversed, then app name
VS Code com.visualstudio.code com = commercial TLD, rest follows
Display name is not the application ID

Commands like flatpak install flathub Firefox will fail or install the wrong package. Always use the full application ID from flatpak search output: flatpak install flathub org.mozilla.firefox

Searching for Applications

Use flatpak search to find applications by name or description across all configured remotes. The output shows the application ID you need for installation.

# Search by keyword — searches name and description
$ flatpak search firefox
Name     Description                  App ID               Version  Branch  Remotes
Firefox  Firefox Web Browser          org.mozilla.firefox  125.0    stable  flathub

# Search returns multiple results — look for the exact App ID
$ flatpak search text editor
Name          Description            App ID                        Version  Branch  Remotes
gedit         Text Editor            org.gnome.gedit               46.0     stable  flathub
Kate          Advanced text editor   org.kde.kate                  24.02    stable  flathub
Mousepad      Xfce text editor       org.xfce.mousepad             0.6.1    stable  flathub

# List all applications available in a specific remote
$ flatpak remote-ls flathub --app

# Filter the remote listing with grep
$ flatpak remote-ls flathub --app | grep -i office
Note the App ID column before installing

The App ID column in flatpak search output is the value to use in all subsequent commands. Write it down or copy it before running the install command.

Installing Applications System-Wide

System-wide installation makes the application available to all users on the system. It requires sudo and stores the application in /var/lib/flatpak/.

# Install from a named remote using the full application ID
$ sudo flatpak install flathub org.mozilla.firefox
Looking for matches…
Required runtime for org.mozilla.firefox not found, searching…
Found match: org.freedesktop.Platform version 23.08
Proceed? [Y/n]: Y
Installing: org.freedesktop.Platform/x86_64/23.08 from flathub
Installing: org.mozilla.firefox/x86_64/stable from flathub
Changes complete.

# Install without any confirmation prompts
$ sudo flatpak install -y flathub org.mozilla.firefox

# Install a specific branch (default is stable)
$ sudo flatpak install flathub org.mozilla.firefox//beta

# Install multiple applications in one command
$ sudo flatpak install -y flathub \
    org.mozilla.firefox \
    org.gimp.GIMP \
    org.libreoffice.LibreOffice
Runtime is installed automatically

When you install a Flatpak application for the first time, its required runtime platform is downloaded and installed automatically. This can be several hundred megabytes. Subsequent applications that share the same runtime do not need to download it again.

Installing Applications Per-User

User-scope installation affects only the current user. No sudo is required, and the application is stored in ~/.local/share/flatpak/.

# Install for the current user only — no sudo needed
$ flatpak install --user flathub org.gnome.gedit

# Confirm the user remote is configured first
$ flatpak remote-list --user

# Add flathub as a user remote if not already present
$ flatpak remote-add --user --if-not-exists \
    flathub \
    https://dl.flathub.org/repo/flathub.flatpakrepo

# Verify where a user installation is stored
$ ls ~/.local/share/flatpak/app/
Scope Command Storage location sudo required?
System sudo flatpak install /var/lib/flatpak/app/ Yes
User flatpak install --user ~/.local/share/flatpak/app/ No

Installing from .flatpakref Files

A .flatpakref file is a single-application descriptor that specifies the application ID, branch, and source remote. It can be used to install an application without knowing the remote URL in advance.

# Contents of a .flatpakref file
$ cat firefox.flatpakref
[Flatpak Ref]
Name=org.mozilla.firefox
Branch=stable
Url=https://dl.flathub.org/repo/
GPGKey=mQINBFlD2sABEADsiUZUO...

# Install from a local .flatpakref file
$ sudo flatpak install --from firefox.flatpakref

# Install from a .flatpakref URL
$ sudo flatpak install --from \
    https://flathub.org/repo/appstream/org.mozilla.firefox.flatpakref

# If the remote is not yet configured, --from adds it automatically
Difference between .flatpakref and .flatpakrepo

A .flatpakrepo file configures access to a remote (repository). A .flatpakref file installs a single application and can also configure its source remote if it is not already set up.

Verifying Installation with flatpak list

After installing, confirm the application is present and note its scope, version, and origin remote.

# List all installed applications (excludes runtimes)
$ flatpak list --app
Name            Application ID              Version  Branch  Origin   Installation
Firefox         org.mozilla.firefox         125.0    stable  flathub  system
GIMP            org.gimp.GIMP               2.10.36  stable  flathub  system

# List both applications and runtimes
$ flatpak list
Name                       Application ID                   ...  Installation
Firefox                    org.mozilla.firefox              ...  system
GIMP                       org.gimp.GIMP                    ...  system
freedesktop.org Platform   org.freedesktop.Platform         ...  system

# List only user-scope installations
$ flatpak list --user --app

# Check if a specific application is installed
$ flatpak list --app | grep org.mozilla.firefox
RHCSA Verification Pattern

After every installation task on the exam, run flatpak list --app to confirm the application ID, version, and installation scope appear correctly before moving on to the next task.

Inspecting Applications with flatpak info

flatpak info shows detailed metadata about an installed application — the Flatpak equivalent of rpm -qi.

$ flatpak info org.mozilla.firefox
ID:              org.mozilla.firefox
Ref:             app/org.mozilla.firefox/x86_64/stable
Arch:            x86_64
Branch:          stable
Version:         125.0.2
License:         MPL-2.0
Origin:          flathub
Collection ID:   org.flathub.Stable
Installation:    system
Installed size:  248.4 MB
Runtime:         org.freedesktop.Platform/x86_64/23.08
Sdk:             org.freedesktop.Sdk/x86_64/23.08

# Show the sandbox permissions for the application
$ flatpak info --show-permissions org.mozilla.firefox

# Show the application metadata manifest
$ flatpak info --show-metadata org.mozilla.firefox
Runtime and SDK fields

The Runtime field shows which platform runtime the application uses. If you remove the application, the runtime remains until you run flatpak uninstall --unused. Multiple applications sharing the same runtime save significant disk space.

Running Installed Applications

Flatpak applications installed system-wide appear in the GNOME Activities launcher automatically. They can also be launched from the terminal with flatpak run.

# Launch an application from the terminal
$ flatpak run org.mozilla.firefox

# Launch with a specific URL
$ flatpak run org.mozilla.firefox https://example.com

# Launch in the background
$ flatpak run org.mozilla.firefox &

# Override sandbox permissions for one run
$ flatpak run --filesystem=home org.mozilla.firefox

# Open a shell inside the application sandbox for debugging
$ flatpak run --command=bash org.mozilla.firefox
Desktop file integration

Flatpak automatically creates a .desktop entry for each installed application in /var/lib/flatpak/exports/share/applications/ for system installations. This is how the application appears in the GNOME launcher without any additional configuration.

Updating Flatpak Applications

Flatpak application updates are independent of dnf system updates. Applications receive updates directly from their remote at any time.

# Update all installed applications and runtimes
$ sudo flatpak update
Looking for updates…
  org.mozilla.firefox  125.0 → 126.0  flathub
Proceed? [Y/n]: Y

# Update a specific application only
$ sudo flatpak update org.mozilla.firefox

# Update without confirmation
$ sudo flatpak update -y

# Check for updates without installing them
$ flatpak remote-ls --updates flathub
Ref                          Installed  Available
app/org.mozilla.firefox      125.0      126.0

# Update user-scope applications
$ flatpak update --user
Updates are independent of dnf

Running sudo dnf update does not update Flatpak applications. Flatpak applications must be updated separately with sudo flatpak update. Some GNOME Software configurations update Flatpak applications automatically in the background.

Removing Flatpak Applications

# Remove a specific application — keeps user data by default
$ sudo flatpak uninstall org.mozilla.firefox
Uninstall complete.

# Remove without confirmation
$ sudo flatpak uninstall -y org.mozilla.firefox

# Remove the application AND its user data in ~/.var/app/
$ sudo flatpak uninstall --delete-data org.mozilla.firefox

# Remove unused runtimes after uninstalling applications
$ sudo flatpak uninstall --unused

# Remove a user-scope installation
$ flatpak uninstall --user org.gnome.gedit

# Confirm removal
$ flatpak list --app
# Application should no longer appear in the list
User data is kept by default

Running flatpak uninstall without --delete-data removes the application binaries but keeps user settings, cache, and profile data in ~/.var/app/. This lets a reinstall pick up where the user left off — but the data must be cleaned up manually if a complete removal is needed.

The Full Application Lifecycle

Every Flatpak task follows the same sequence. Knowing this pattern makes any application management task predictable.

  1. Confirm remote is configured
    flatpak remote-list
  2. Find the application ID
    flatpak search keyword — note the App ID column
  3. Install the application
    sudo flatpak install flathub org.app.Name
  4. Verify the installation
    flatpak list --app — confirm ID, version, scope appear
  5. Use or inspect the application
    flatpak run org.app.Name or flatpak info org.app.Name
  6. Update when needed
    sudo flatpak update org.app.Name
  7. Remove when no longer needed
    sudo flatpak uninstall org.app.Name then sudo flatpak uninstall --unused

Flatpak vs dnf: Parallel Commands

Knowing the dnf equivalent of each Flatpak command helps students transfer existing knowledge to the new tool.

Task dnf (RPM) flatpak
Search for softwarednf search keywordflatpak search keyword
Show package detailsdnf info pkgflatpak info org.app.Name
Install softwaresudo dnf install pkgsudo flatpak install remote org.app.Name
List installed softwarednf list installedflatpak list --app
Check for updatesdnf check-updateflatpak remote-ls --updates remote
Update softwaresudo dnf update pkgsudo flatpak update org.app.Name
Remove softwaresudo dnf remove pkgsudo flatpak uninstall org.app.Name
Configure repositoryCreate .repo fileflatpak remote-add remote-name URL

Application Data Locations

Understanding where Flatpak stores data is essential for administration, troubleshooting, and cleaning up after removal.

Location Contents Removed by uninstall?
/var/lib/flatpak/app/ System-wide installed applications Yes — with sudo flatpak uninstall
/var/lib/flatpak/runtime/ System-wide installed runtimes Only with --unused flag
~/.local/share/flatpak/app/ User-scope installed applications Yes — with flatpak uninstall --user
~/.local/share/flatpak/runtime/ User-scope installed runtimes Only with --unused flag
~/.var/app/org.app.Name/ Per-user application data: config, cache, profile Only with --delete-data flag
/var/lib/flatpak/exports/ Desktop integration files (.desktop, icons, MIME types) Yes — automatically on uninstall

Common Mistakes

Mistake What goes wrong Correct approach
Using the display name instead of the application ID flatpak install flathub Firefox fails — "not found" Use flatpak search firefox first to get the ID: org.mozilla.firefox
Omitting the remote name in the install command Flatpak asks which remote to use, or installs from the wrong one Always specify: flatpak install flathub org.app.Name
Forgetting sudo for system-wide install Permission denied — system installation requires root Use sudo flatpak install for system scope
Not verifying after installation Task is assumed complete but application may not have installed Always run flatpak list --app after installing
Skipping flatpak uninstall --unused after removal Runtime platforms remain, consuming hundreds of megabytes Always run sudo flatpak uninstall --unused after removing applications
Confusing flatpak list and flatpak remote-list list shows installed apps; remote-list shows configured remotes Use flatpak list --app to see installed apps; flatpak remote-list to see remotes

Knowledge Check

Answer these before moving to the next slide.

  1. Write the command to search for Flatpak applications related to the keyword calculator.
  2. The search results show an application with ID org.gnome.Calculator available in the flathub remote. Write the command to install it system-wide without a confirmation prompt.
  3. After installation, write the command to verify that org.gnome.Calculator appears in the installed application list.
  4. Write the command to display detailed information about the installed org.gnome.Calculator application, including its version, installed size, and runtime.
  5. Write the command to remove org.gnome.Calculator and then clean up any runtimes that are no longer needed by other applications.
  6. What is the difference between flatpak uninstall org.gnome.Calculator and flatpak uninstall --delete-data org.gnome.Calculator?

Knowledge Check — Answers

  1. flatpak search calculator — searches application names and descriptions across all configured remotes and returns matching results with their IDs.
  2. sudo flatpak install -y flathub org.gnome.Calculator — the -y flag skips the confirmation prompt; flathub is the remote name; org.gnome.Calculator is the full application ID.
  3. flatpak list --app — the output should show a row with org.gnome.Calculator in the Application ID column and system in the Installation column.
  4. flatpak info org.gnome.Calculator — displays the version, installed size, origin remote, installation scope, and runtime platform in a structured summary.
  5. Two commands: first sudo flatpak uninstall org.gnome.Calculator to remove the application, then sudo flatpak uninstall --unused to remove any runtime platforms no longer required by other installed applications.
  6. flatpak uninstall org.gnome.Calculator removes the application binaries but keeps user data in ~/.var/app/org.gnome.Calculator/ — useful when the user may reinstall later.
    flatpak uninstall --delete-data org.gnome.Calculator also removes all user data — a complete clean-slate removal with nothing left behind.

Key Takeaways

  1. Always find the full application ID before installing. Run flatpak search keyword and copy the exact reverse-domain ID from the App ID column. Display names like "Firefox" do not work — only org.mozilla.firefox does.
  2. The install command requires four parts. sudo flatpak install flathub org.app.Name — sudo for system scope, flatpak install as the command, the remote name, and the full application ID. Add -y to skip the confirmation prompt.
  3. Verify every installation with flatpak list --app. The output confirms the application ID, version, origin remote, and installation scope. Do not move on to the next task until verification succeeds.
  4. Removal takes two commands. sudo flatpak uninstall org.app.Name removes the application. sudo flatpak uninstall --unused removes orphaned runtimes. Add --delete-data to the first command if user data should also be removed.

Graded Lab

  • Confirm the Flathub remote is configured with flatpak remote-list. If it is missing, add it before continuing.
  • Use flatpak search to find the application ID for GIMP (GNU Image Manipulation Program). Record the exact ID shown in the output.
  • Install GIMP system-wide using the full application ID and the -y flag to skip confirmation. Note the runtime that is installed alongside it.
  • Run flatpak list --app to confirm GIMP appears with system scope. Then run flatpak info org.gimp.GIMP and record the installed size and runtime name.
  • Install a second application of your choice from Flathub. After installation, list all installed applications and confirm both appear.
  • Remove GIMP with flatpak uninstall. Then remove the second application. Run flatpak uninstall --unused to clean up runtimes. Confirm with flatpak list --app that no applications remain.
RHCSA Objective

"Install and remove Flatpak software packages." The exam tests: finding an application ID, installing from a named remote, verifying with flatpak list --app, and removing cleanly.