GUIDE 16 / ADMINISTRATION
Packages & repositories
Find which package owns a file and where software comes from.
In this guide
Commands use class paths and example filenames. Replace placeholders and inspect the target before making changes.
Inventory installed software
RPM queries installed package records. DNF works with repositories and resolves dependencies. The installed package count depends on the machine and changes as software is added.
rpm -qa | wc -l
rpm -q nginx-core
dnf repolist
dnf info nginxThe subscription-management message shown to a non-root RHEL user does not by itself mean the repository query failed. Read the repository list and command result.
Find the package behind a command
-qf queries ownership of a path. -qc lists configuration files tracked by a package. dnf provides searches for a package supplying a file.
rpm -qf /etc/nginx/nginx.conf
rpm -qc nginx-core
rpm -qf "$(command -v docker)"
dnf provides /usr/bin/vimdiffOn the observed production server, nginx-core owns nginx.conf, docker-ce-cli owns the docker command, and vim-enhanced provides vimdiff. Package layouts can differ between distributions.
Inspect dependencies and provenance
A program may require a shared library supplied by another package. Inspect package requirements and repository information rather than guessing from a filename.
rpm -qR bmon
rpm -q libconfuse
dnf info bmonIn the lab, bmon came from EPEL and required libconfuse.so.2, provided by libconfuse. DNF installed the dependency automatically.
Treat repository changes as administration
RHEL AppStream and BaseOS provide distribution packages. EPEL adds community-maintained packages; CodeReady Builder supplies additional build and library packages. Docker CE uses its own repository.
ls /etc/yum.repos.d/
rpm -q epel-release
dnf repolistConfirm architecture, distribution release, repository source, and signing-key fingerprint before enabling a new source. The production server is x86_64 while the UTM development server is aarch64.