nerdexam
CompTIA

LX0-103 · Question #10

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

The correct answer is B. rpm -qf /etc/exports. The rpm -qf option queries the RPM database to identify which installed package owns a specific file on the filesystem.

Linux Installation and Package Management

Question

Which RPM command will output the name of the package which supplied 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

(52 responses)
  • A
    2% (1)
  • B
    90% (47)
  • D
    6% (3)
  • E
    2% (1)

Why each option

The rpm -qf option queries the RPM database to identify which installed package owns a specific file on the filesystem.

Arpm -F /etc/exports

The -F flag is the 'freshen' option used to upgrade packages only if an older version is already installed; it does not query file ownership.

Brpm -qf /etc/exportsCorrect

The -q flag places rpm in query mode, and -f (file) directs it to look up which package owns the specified file path. Running 'rpm -qf /etc/exports' searches the installed package database and returns the package name that provided that file, which in this case would be the nfs-utils package.

Crpm -Kl /etc/exports

The -K flag is used to verify package signatures, and combining it with -l is not a valid query operation for file ownership.

Drpm -qp /etc/exports

The -qp flag queries an uninstalled RPM package file directly, not the installed package database, and requires a .rpm file path as its argument.

Erpm -qi /etc/exports

The -qi flag displays general package information such as name, version, and description, but requires a package name as input, not a file path.

Concept tested: RPM query to find file-owning package

Source: https://man7.org/linux/man-pages/man8/rpm.8.html

Topics

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

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice