2. Manage Software
πRed Hat Certified System Administrator (RHCSA β EX200)
1. What is Flatpak?
Flatpak is a system for installing and managing software on Linux in a way that is independent of your Linux distribution.
- Traditional Linux software is installed using RPM (Red Hat, Fedora, CentOS) or DEB (Debian, Ubuntu) packages. These depend on system libraries and versions.
- Flatpak packages include their own libraries and dependencies, which makes them isolated and reduces conflicts with other software.
- This is useful in IT environments when multiple applications need different versions of libraries without breaking the system.
Think of Flatpak as self-contained software apps. They are sandboxed, meaning they run safely without interfering with the rest of the system.
2. Installing Flatpak on a RHEL system
Before using Flatpak, you must install Flatpak itself.
- Make sure your system is connected to the internet.
- Run:
sudo dnf install flatpak
dnfis the package manager used in RHEL-based systems.- After this, your system can install and manage Flatpak apps.
3. Adding Flatpak Repositories
Flatpak uses repositories to find and install apps. The most common is Flathub.
- Add Flathub repository:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
remote-addadds a new source of Flatpak packages.--if-not-existsprevents adding the same repo twice.
- List all Flatpak remotes (to verify):
flatpak remotes
- Output shows
flathubif added successfully.
4. Searching for Flatpak Applications
Before installing, you can search for software:
flatpak search <application-name>
Example:
flatpak search gimp
- This searches Flathub for the GIMP image editor.
- Youβll see the app name, ID, and description.
5. Installing Flatpak Applications
To install a software package using Flatpak:
sudo flatpak install flathub <application-ID>
- Replace
<application-ID>with the exact ID from the search result. - Example:
sudo flatpak install flathub org.gimp.GIMP
- Flatpak will show the app size, dependencies, and ask for confirmation. Type
yto proceed. - Flatpak apps are installed in
/var/lib/flatpak/(system-wide) or~/.local/share/flatpak/(user-only).
6. Running Flatpak Applications
After installation, you can run the app with:
flatpak run <application-ID>
Example:
flatpak run org.gimp.GIMP
- This is similar to typing the app name in a normal Linux shell.
- You can also find it in the desktop menu if your GUI is installed.
7. Updating Flatpak Applications
Flatpak apps do not update with dnf. To update:
sudo flatpak update
- This updates all Flatpak applications installed on the system.
- You can update a single app too:
sudo flatpak update org.gimp.GIMP
8. Listing Installed Flatpak Applications
To see all apps installed via Flatpak:
flatpak list
- Output includes App ID, Version, Branch, and Installation source.
9. Removing Flatpak Applications
To remove/uninstall a Flatpak app:
sudo flatpak uninstall <application-ID>
Example:
sudo flatpak uninstall org.gimp.GIMP
- You can also remove unused runtimes (libraries apps depend on) with:
sudo flatpak uninstall --unused
- This cleans up unnecessary space on the system.
10. Important Points for the Exam
For RHCSA EX200, you need to:
- Install Flatpak itself using
dnf. - Add Flathub repository for extra apps.
- Search, install, run, update, and remove Flatpak applications.
- Understand the difference between system-wide and user installation.
- Use commands like:
flatpak install,flatpak uninstall,flatpak runflatpak search,flatpak list,flatpak updateflatpak remote-add,flatpak remotes
11. IT Environment Example
- In a Linux server, you might need specific tools like
GIMPorVisual Studio Codethat require newer libraries than what the system has. - Using Flatpak, you can install these tools without changing system libraries, keeping the server stable.
- Developers can run multiple versions of the same app safely.
β Summary Table of Key Commands
| Task | Command Example |
|---|---|
| Install Flatpak | sudo dnf install flatpak |
| Add Flathub Repository | sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo |
| Search for Apps | flatpak search <app-name> |
| Install App | sudo flatpak install flathub <app-ID> |
| Run App | flatpak run <app-ID> |
| List Installed Apps | flatpak list |
| Update Apps | sudo flatpak update |
| Remove App | sudo flatpak uninstall <app-ID> |
| Remove Unused Runtimes | sudo flatpak uninstall --unused |
