← All chapters · Book · Repository
Chapter 9: Package Management Answers
Red Hat RHCSA 10 Study Companion: Getting Ready for the EX200 Exam by Andrey Markelov (May 2026).
Topics
- DNF operations
- RPM queries
- Repository management
- Flatpak applications
exercise_01.sh
executable safe: yes#!/bin/bash
# @type: executable
# @requires: none
# @safe: yes
set -euo pipefail
# Exercise 1: Use DNF to search for packages related to the "network" term,
# listing only packages that are not yet installed.
#
# Task: Search for available network-related packages.
sudo dnf list available *network*
exercise_02.sh
executable safe: no requires: root#!/bin/bash
# @type: executable
# @requires: root
# @safe: no
set -euo pipefail
# Exercise 2: Install the zsh package using DNF, ensuring the installation proceeds
# without any interactive prompts.
#
# Task: Install zsh package non-interactively.
sudo dnf install -y zsh
exercise_03.sh
executable safe: no requires: root#!/bin/bash
# @type: executable
# @requires: root
# @safe: no
set -euo pipefail
# Exercise 3: Remove the zsh package and any dependencies that are no longer needed,
# using a single DNF command.
#
# Task: Uninstall zsh and clean up unused dependencies.
sudo dnf remove -y zsh
exercise_04.sh
executable safe: no requires: root#!/bin/bash
# @type: executable
# @requires: root
# @safe: no
set -euo pipefail
# Exercise 4: Display a detailed description and list of packages (mandatory, default, and optional)
# included in the "Legacy UNIX Compatibility" package group.
#
# Task: Show information about a package group.
sudo dnf group info "Legacy UNIX Compatibility"
exercise_05.sh
executable safe: yes#!/bin/bash
# @type: executable
# @requires: none
# @safe: yes
set -euo pipefail
# Exercise 5: Determine which installed RPM package owns the /etc/filesystems file.
#
# Task: Find the package that provides a specific file.
rpm -qf /etc/filesystems
exercise_06.sh
executable safe: yes#!/bin/bash
# @type: executable
# @requires: none
# @safe: yes
set -euo pipefail
# Exercise 6: Use the rpm command to list all files included in the installed bash package.
#
# Task: Display all files provided by the bash package.
sudo rpm -ql bash
exercise_07.sh
executable safe: no requires: root#!/bin/bash
# @type: executable
# @requires: root
# @safe: no
set -euo pipefail
# Exercise 7: Use the dnf config-manager utility to enable the
# codeready-builder-for-rhel-10-x86_64-rpms repository.
#
# Task: Enable a DNF repository.
sudo dnf config-manager --enable codeready-builder-for-rhel-10-x86_64-rpms
exercise_08.sh
executable safe: no requires: root#!/bin/bash
# @type: executable
# @requires: root
# @safe: no
set -euo pipefail
# Exercise 8: Install virt-manager package.
#
# Task: Install the virt-manager virtualization management tool.
sudo dnf install -y virt-manager
exercise_09.sh
executable safe: yes#!/bin/bash
# @type: executable
# @requires: none
# @safe: yes
set -euo pipefail
# Exercise 9: Write the flatpak command to add the Flathub remote repository only
# for the current user, without system-wide privileges, and only if the remote doesn't already exist.
#
# Task: Add Flathub repository for user-level flatpak installations.
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
echo "Flathub repository added for current user."
exercise_10.sh
executable safe: no requires: root#!/bin/bash
# @type: executable
# @requires: root
# @safe: no
set -euo pipefail
# Exercise 10: Install Gimp from Flathub.
#
# Task: Install the GIMP image editor using flatpak.
flatpak install flathub org.gimp.GIMP
echo "GIMP has been installed via Flatpak."