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.
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)- A2% (1)
- B90% (47)
- D6% (3)
- E2% (1)
Why each option
The rpm -qf option queries the RPM database to identify which installed package owns a specific file on the filesystem.
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.
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.
The -K flag is used to verify package signatures, and combining it with -l is not a valid query operation for file ownership.
The -qp flag queries an uninstalled RPM package file directly, not the installed package database, and requires a .rpm file path as its argument.
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
Community Discussion
No community discussion yet for this question.