CompTIA Linux+ (XK0-006)System ManagementMedium

A technician needs to verify the exact installed version and release number of the 'httpd' package on a Fedora-based server without querying remote repositories. Which command should be used?

  1. Arpm -q httpd
  2. Bdnf list available httpd
  3. Cdnf search httpd
  4. Drpm -qa
Show answer & explanation

Correct answer: A. rpm -q httpd

rpm -q queries the local RPM database directly for a specific package's installed version, requiring no network access. dnf search and dnf list available query repository metadata, and rpm -qa lists all installed packages requiring additional filtering.

Why the other options are wrong

  • B. Lists versions available in repositories, not necessarily what's installed.
  • C. Searches repository metadata for matching package names, not local install status.
  • D. Lists all installed packages, requiring extra filtering to find httpd.

rpm -q Query

rpm -q <package> reports the installed version-release of a package directly from the local RPM database, with no network access needed.

  • -q queries installed packages locally
  • -qa lists all installed packages
  • -qi shows detailed package info
  • dnf commands often query remote repo metadata instead

Memory trick: rpm -q = Quick local Query, no internet needed

More System Management questions