Table of Contents

  1. RPM & DNF Guide (RHCSA Exam Focus)
    1. 1. RPM (Red Hat Package Manager)
      1. Check if a package is installed
      2. List all installed packages
      3. Get package info
      4. List files installed by a package
      5. Find which package owns a file
      6. Verify a package (check for missing/corrupted files)
      7. Install a package (local .rpm file)
      8. Upgrade a package
      9. Remove a package
    2. 2. DNF (Dandified YUM)
      1. Search for a package
      2. Get package info
      3. Install a package
      4. Remove a package
      5. Update all packages
      6. Check for available updates
      7. Upgrade a package
      8. Reinstall a package
      9. List installed packages
      10. List available packages
      11. List package groups
      12. Install a group of packages
      13. Remove a group of packages
    3. 3. Repository Management
      1. Show enabled repositories
      2. Show all repositories (enabled + disabled)
      3. Temporary enable/disable repo
      4. Permanently enable/disable a repo
    4. 4. Exam Tips & Tricks
    5. Practice Scenarios

RPM & DNF Guide (RHCSA Exam Focus)

This guide covers RPM and DNF package management commands relevant to the RHCSA exam.
Use this as a reference for study and practice.


1. RPM (Red Hat Package Manager)

Check if a package is installed

rpm -q package_name

List all installed packages

rpm -qa

Get package info

rpm -qi package_name

List files installed by a package

rpm -ql package_name

Find which package owns a file

rpm -qf /path/to/file

Verify a package (check for missing/corrupted files)

rpm -V package_name

Install a package (local .rpm file)

rpm -ivh package_name.rpm

Upgrade a package

rpm -Uvh package_name.rpm

Remove a package

rpm -e package_name

2. DNF (Dandified YUM)

DNF is the default package manager in RHEL 8/9.

Search for a package

dnf search package_name

Get package info

dnf info package_name

Install a package

dnf install package_name -y

Remove a package

dnf remove package_name -y

Update all packages

dnf update -y

Check for available updates

dnf check-update

Upgrade a package

dnf upgrade package_name -y

Reinstall a package

dnf reinstall package_name

List installed packages

dnf list installed

List available packages

dnf list available

List package groups

dnf group list

Install a group of packages

dnf groupinstall "Server with GUI" -y

Remove a group of packages

dnf groupremove "Server with GUI" -y

3. Repository Management

Show enabled repositories

dnf repolist enabled

Show all repositories (enabled + disabled)

dnf repolist all

Temporary enable/disable repo

dnf --enablerepo=repo_name install package_name
dnf --disablerepo=repo_name install package_name

Permanently enable/disable a repo

Edit the repo file under:

/etc/yum.repos.d/*.repo

Example section in .repo file:

[baseos]
name=RHEL BaseOS
baseurl=http://content.example.com/rhel9/baseos
enabled=1
gpgcheck=1

4. Exam Tips & Tricks

  • Know how to install, update, and remove packages with dnf.
  • Be familiar with rpm -qf for finding which package owns a file.
  • Understand how to list repos and edit .repo files under /etc/yum.repos.d/.
  • Be able to verify package integrity using rpm -V.
  • Practice group installs for environments like Server with GUI.

Practice Scenarios

  1. Verify which package owns /bin/ls.
  2. Install the httpd package and verify its version.
  3. Enable a disabled repo and install a package from it.
  4. Perform a group installation for "Development Tools".
  5. Remove vsftpd and confirm it is gone.

This guide aligns with RHCSA exam objectives for RPM/DNF package management.