RED HAT ENTERPRISE LINUX
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
-
Find Flatpak applications by name and ID —
Use
flatpak searchandflatpak remote-lsto identify the correct application ID before installing -
Install Flatpak applications —
Use
flatpak installwith system and user scope, and install from.flatpakreffiles -
Query and verify installed applications —
Use
flatpak listandflatpak infoto confirm installation and inspect application details -
Update and remove Flatpak applications —
Use
flatpak updateandflatpak uninstallto 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 |
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
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
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
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
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
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
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
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
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.
-
Confirm remote is configured
flatpak remote-list -
Find the application ID
flatpak search keyword— note the App ID column -
Install the application
sudo flatpak install flathub org.app.Name -
Verify the installation
flatpak list --app— confirm ID, version, scope appear -
Use or inspect the application
flatpak run org.app.Nameorflatpak info org.app.Name -
Update when needed
sudo flatpak update org.app.Name -
Remove when no longer needed
sudo flatpak uninstall org.app.Namethensudo 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 software | dnf search keyword | flatpak search keyword |
| Show package details | dnf info pkg | flatpak info org.app.Name |
| Install software | sudo dnf install pkg | sudo flatpak install remote org.app.Name |
| List installed software | dnf list installed | flatpak list --app |
| Check for updates | dnf check-update | flatpak remote-ls --updates remote |
| Update software | sudo dnf update pkg | sudo flatpak update org.app.Name |
| Remove software | sudo dnf remove pkg | sudo flatpak uninstall org.app.Name |
| Configure repository | Create .repo file | flatpak 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.
- Write the command to search for Flatpak applications related to
the keyword
calculator. - The search results show an application with ID
org.gnome.Calculatoravailable in theflathubremote. Write the command to install it system-wide without a confirmation prompt. - After installation, write the command to verify that
org.gnome.Calculatorappears in the installed application list. - Write the command to display detailed information about the installed
org.gnome.Calculatorapplication, including its version, installed size, and runtime. - Write the command to remove
org.gnome.Calculatorand then clean up any runtimes that are no longer needed by other applications. - What is the difference between
flatpak uninstall org.gnome.Calculatorandflatpak uninstall --delete-data org.gnome.Calculator?
Knowledge Check — Answers
flatpak search calculator— searches application names and descriptions across all configured remotes and returns matching results with their IDs.sudo flatpak install -y flathub org.gnome.Calculator— the-yflag skips the confirmation prompt;flathubis the remote name;org.gnome.Calculatoris the full application ID.flatpak list --app— the output should show a row withorg.gnome.Calculatorin the Application ID column andsystemin the Installation column.flatpak info org.gnome.Calculator— displays the version, installed size, origin remote, installation scope, and runtime platform in a structured summary.- Two commands: first
sudo flatpak uninstall org.gnome.Calculatorto remove the application, thensudo flatpak uninstall --unusedto remove any runtime platforms no longer required by other installed applications. flatpak uninstall org.gnome.Calculatorremoves 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.Calculatoralso removes all user data — a complete clean-slate removal with nothing left behind.
Key Takeaways
-
Always find the full application ID before installing.
Run
flatpak search keywordand copy the exact reverse-domain ID from the App ID column. Display names like "Firefox" do not work — onlyorg.mozilla.firefoxdoes. -
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-yto skip the confirmation prompt. -
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. -
Removal takes two commands.
sudo flatpak uninstall org.app.Nameremoves the application.sudo flatpak uninstall --unusedremoves orphaned runtimes. Add--delete-datato 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 searchto 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
-yflag to skip confirmation. Note the runtime that is installed alongside it. - Run
flatpak list --appto confirm GIMP appears with system scope. Then runflatpak info org.gimp.GIMPand 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. Runflatpak uninstall --unusedto clean up runtimes. Confirm withflatpak list --appthat no applications remain.
"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.