Mikey’s Linux Field NotesAll topics

GUIDE 16 / ADMINISTRATION

Packages & repositories

Find which package owns a file and where software comes from.

4 quick lessons · Examples to adapt to your server
In this guide
Inventory installed softwareFind the package behind a commandInspect dependencies and provenanceTreat repository changes as administration

Commands use class paths and example filenames. Replace placeholders and inspect the target before making changes.

01

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.

COMMANDS & EXAMPLES
rpm -qa | wc -l
rpm -q nginx-core
dnf repolist
dnf info nginx
Field note

The 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.

02

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.

COMMANDS & EXAMPLES
rpm -qf /etc/nginx/nginx.conf
rpm -qc nginx-core
rpm -qf "$(command -v docker)"
dnf provides /usr/bin/vimdiff
Field note

On 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.

03

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.

COMMANDS & EXAMPLES
rpm -qR bmon
rpm -q libconfuse
dnf info bmon
Field note

In the lab, bmon came from EPEL and required libconfuse.so.2, provided by libconfuse. DNF installed the dependency automatically.

04

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.

COMMANDS & EXAMPLES
ls /etc/yum.repos.d/
rpm -q epel-release
dnf repolist
Field note

Confirm 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.