Red Hat: dnf/yum & rpm

Red Hat / Fedora - dnf & rpm

The Red Hat family (RHEL, Fedora, Rocky, CentOS) mirrors the same two-tier design you just saw on Debian - a low-level tool (rpm) for single package files, and a high-level tool (dnf, the modern successor to yum) that talks to repositories and resolves dependencies.

TaskCommand
Installdnf install <pkg>
Removednf remove <pkg>
Upgrade alldnf upgrade
Searchdnf search <term>
Infodnf info <pkg>
Package groupsdnf group list / dnf group install
Install a local .rpmrpm -ivh file.rpm
Query installedrpm -qa
Which package owns a filerpm -qf /path
List a package's filesrpm -ql <pkg>

Unlike apt, dnf doesn't need a separate "update the index" step before every install - it checks repository metadata automatically and caches it. Repos themselves are defined in .repo files under /etc/yum.repos.d/.

$ rpm -qf /usr/bin/ssh
openssh-clients-8.7p1-34.el9.x86_64

This is the same "which package owns this file?" question from the Debian section, just with the Red Hat equivalent flag (-qf = query, file).

Tip: rpm's flags read almost like English once you memorize them as words rather than letters: -i install, -v verbose (show progress), -h hash marks (a progress bar made of #), -U upgrade-or-install in one step, -e erase (remove), -q query. rpm -ivh file.rpm is "install, verbosely, with a hash progress bar" - a combination you'll type from memory after a week on Red Hat systems.