Configure access to Flatpak repositories

2. Manage Software

📘Red Hat Certified System Administrator (RHCSA – EX200)


In Linux, software can be installed in different ways. Flatpak is a modern system for installing applications that are sandboxed (isolated from the rest of the system), which makes them safer and easier to manage.

Flatpak uses repositories (also called “remotes”) to store and provide applications. To install apps from Flatpak, you need to configure access to these repositories. This is what this topic focuses on.


1. Understanding Flatpak Repositories

  • What is a Flatpak repository (remote)?
    • A repository (remote) is a server or online source that stores Flatpak applications.
    • Common default repository: Flathub (https://flathub.org), which hosts most popular apps.
  • Why configure repositories?
    • Without adding a repository, you cannot install Flatpak apps.
    • You may also want to add internal company repositories or special remotes for extra software.
  • Check existing Flatpak repositories
flatpak remotes

This will list all configured remotes with:

  • Name – the short name of the repository
  • URL – the web address of the repository
  • Priority/Options – information about trust level, GPG keys, etc.

2. Adding a Flatpak Repository

To use software from a Flatpak repository, you add it as a remote:

Syntax

flatpak remote-add [--if-not-exists] <remote_name> <repository_url>

Examples

  1. Add Flathub repository (the most common)
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  • --if-not-exists ensures it doesn’t add the same repository twice.
  • After adding, you can install apps like flatpak install flathub org.gnome.Gedit.
  1. Add a company/internal repository
flatpak remote-add internal-repo https://repo.company.com/internal.flatpakrepo
  • You might need to configure GPG keys to trust it.

3. Removing a Flatpak Repository

If a repository is no longer needed, you can remove it:

flatpak remote-delete <remote_name>

Example:

flatpak remote-delete internal-repo

4. Modifying or Updating Repositories

  • Update repository metadata (like new apps or new versions):
flatpak update --appstream
  • This refreshes the list of apps available from all remotes.
  • Change repository options
    Usually, this is rare for exams. But some repositories may have options like:
    • --user → repository is only for the current user, not system-wide.
    • --gpg-import → import a GPG key for a trusted repo.

5. Exam Focus

For the RHCSA exam, you should be able to:

  1. List all Flatpak repositories
flatpak remotes
  1. Add a Flatpak repository (system-wide or per user)
flatpak remote-add --if-not-exists <name> <URL>
  1. Remove a Flatpak repository
flatpak remote-delete <name>
  1. Understand which apps are available after adding a repository
flatpak search <app_name>
  1. Install apps from a Flatpak repository
flatpak install <remote_name> <app_name>

Tip: In the exam, the tasks may be:

  • Add Flathub
  • Remove a repository
  • Install an app from the repository

6. Key Points to Remember

  • Flatpak repositories = software sources.
  • remote-add = add repository.
  • remote-delete = remove repository.
  • --if-not-exists avoids duplicate entries.
  • --user vs system-wide:
    • --user → only current user can install apps
    • System-wide → all users can install apps
  • Always check with flatpak remotes before making changes.
  • After adding a repository, refresh metadata (flatpak update --appstream) if needed.

7. Common Commands Summary

TaskCommand Example
List repositoriesflatpak remotes
Add Flathubflatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Remove a repoflatpak remote-delete <name>
Install app from repoflatpak install flathub org.gnome.Gedit
Search appflatpak search <app_name>
Update repo metadataflatpak update --appstream

Conclusion:
Being able to add, remove, and list Flatpak repositories is enough for RHCSA. Remember, the main repository in real IT environments is Flathub, but companies can have their own internal Flatpak repositories. Knowing how to handle these is essential for software management on modern Linux systems.

Buy Me a Coffee