nerdexam
CompTIA

LX0-103 · Question #22

Which RPM command will output the name of the package which installed the file /etc/exports?

The correct answer is B. rpm -qf /etc/exports. The rpm -qf command queries the RPM database to identify which installed package owns a specified file path.

Linux Installation and Package Management

Question

Which RPM command will output the name of the package which installed the file /etc/exports?

Options

  • Arpm -F /etc/exports
  • Brpm -qf /etc/exports
  • Crpm -Kl /etc/exports
  • Drpm -qp /etc/exports
  • Erpm -qi /etc/exports

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    90% (27)
  • E
    7% (2)

Why each option

The rpm -qf command queries the RPM database to identify which installed package owns a specified file path.

Arpm -F /etc/exports

rpm -F is the freshen operation, which upgrades already-installed packages from provided package files, and performs no file ownership query.

Brpm -qf /etc/exportsCorrect

The -q flag puts rpm into query mode and the -f flag specifies a file path as the target, causing rpm to search the installed package database for the package that placed that file on the system. This reverse file-to-package lookup is the correct approach for identifying package ownership of /etc/exports.

Crpm -Kl /etc/exports

rpm -K verifies the cryptographic signature of a package file; combining it with -l does not produce a file-to-package query.

Drpm -qp /etc/exports

rpm -qp queries metadata from an uninstalled .rpm package archive file, not a file already present on the filesystem.

Erpm -qi /etc/exports

rpm -qi displays information about an installed package referenced by its package name, not by a filesystem file path.

Concept tested: RPM query to find package owning a file

Source: https://rpm.org/documentation.html

Topics

#RPM#rpm -qf#package query#file ownership

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice