LFCS · Question #823
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. To determine which RPM package owns a specific file, the rpm -qf command is used, followed by the full path to the file.
Question
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
(44 responses)- B86% (38)
- C5% (2)
- D7% (3)
- E2% (1)
Why each option
To determine which RPM package owns a specific file, the `rpm -qf` command is used, followed by the full path to the file.
The `rpm -F` command is used to 'freshen' packages, meaning it upgrades packages only if an older version is already installed.
The `rpm -qf` command (query file) is specifically designed to query the RPM database and identify which installed package provided the specified file. This is useful for troubleshooting or understanding package dependencies.
The `rpm -Kl` command is not a standard or valid option for querying file ownership; the `-K` option is for checking package signatures.
The `rpm -qp` command is used to query an *uninstalled* package file (e.g., a .rpm file) for information, not a file already on the filesystem.
The `rpm -qi` command provides detailed information about an *installed* package by its name, not by a file path.
Concept tested: RPM package file ownership query
Source: https://man7.org/linux/man-pages/man8/rpm.8.html
Topics
Community Discussion
No community discussion yet for this question.