Instiq
Chapter 4 · Repositories and Package Management·v1.0.0·Updated 7/6/2026·~9 min

What's changed: Initial version (topic 1.04, subtopics 1.04.1–1.04.4)

4.4RPM Package Management

Key points

Learn direct handling and querying of rpm packages without a repository: obtaining version/status/dependency/integrity/signature information with rpm (-q family), listing a package's files (-ql), and reverse lookup of a file's owner (-qf).

Beneath yum, rpm does the actual work (the same relationship dpkg has to apt). It resolves no dependencies, but its query features for installed packages are rich—you reach for it directly in audits and troubleshooting.

4.4.1The -q query family

  • Basics: rpm -q pkg (version), rpm -qa (all installedrpm -qa | grep httpd is the idiom), rpm -qi (details).
  • File directions: rpm -ql pkg (package → file list), rpm -qf /path (file → owning package).
  • Dependencies with rpm -qR (requires). Inspect a file not yet installed by adding -p (rpm -qlp package.rpm).
  • Integrity/signature: rpm -V pkg (verification—detects size/hash/permission changes), rpm --checksig package.rpm (signature check).
Exam point

The four keys: -qa = list all, -ql = package→files, -qf = file→package, -V = tamper verification. Map them to dpkg (-ql ↔ dpkg -L, -qf ↔ dpkg -S) to handle questions on either family. Like dpkg, rpm resolves no dependencies (yum does).

Picture a security incident's first response and rpm queries come alive. "Found an unfamiliar binary /usr/local/bin/x" → rpm -qf tells which package owns it (owned by none = manually placed, investigate). "Suspected tampering" → rpm -V coreutils reports changes since install (S size, 5 hash, M mode, shown as flags). "What does this package require?" → rpm -qR. Install operations exist (rpm -ivh, upgrade -Uvh, erase -e), but to avoid dependency hell normal installs go through yum; direct rpm shines at querying and verifying standalone rpm files. As with dpkg, -p switches between the installed DB and an rpm file itself.

QuestionRPM familyDebian family (equiv.)
List all packagesrpm -qadpkg -l
Package → filesrpm -qldpkg -L
File → packagerpm -qfdpkg -S
Verify integrityrpm -V(dpkg --verify)
Warning

Trap: "rpm -i fetches and resolves dependencies from the repository" is wrong—rpm handles only the given file; dependency resolution is yum's job. And "-qf lists the files a package owns" is wrong—that is -ql; -qf goes the other way (file → package).

rpm -qa/-qi/-qR, -ql/-qf, and -V/--checksig at a glance.
Query master, no dependency resolution

4.4.2Section summary

  • rpm = master of queries, no dependency resolution: -qa list, -qi info, -qR requires, -V verify (-p targets rpm files)
  • Learn by direction: -ql = pkg→files ↔ dpkg -L / -qf = file→pkg ↔ dpkg -S

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. You want to know which package installed /etc/httpd/conf/httpd.conf. Which command?

Q2. You want to verify that an installed package's files have not been altered since installation. Which command?

Q3. You want to find httpd-related entries among all installed packages. The standard command?

Check your understandingPractice questions for Chapter 4: Repositories and Package Management

Keep track of your progress

The full study guide is free to read. Sign up free to practice with the question bank, track what you have read, review your mistakes, and highlight passages.