LFCS · Question #835
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 is used to query the RPM database to determine which installed package owns a specific 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
(31 responses)- A3% (1)
- B94% (29)
- C3% (1)
Why each option
The `rpm -qf` command is used to query the RPM database to determine which installed package owns a specific file.
The `rpm -F` command is used to "freshen" or update an installed package, not to identify which package owns a file.
The `rpm -qf /etc/exports` command is used to query the RPM database for the name of the installed package that owns the specified file `/etc/exports`. The `q` signifies a query operation, and `f` specifies querying by file.
`rpm -Kl` is not a valid or standard option combination for identifying a package by file; `-K` is for checking package signatures, and `-l` lists files *in* a known package.
The `rpm -qp` command is used to query an uninstalled RPM package file (e.g., a `.rpm` file) for information, not to find the owner of an already installed file on the system.
The `rpm -qi` command displays general information about an *already known* installed package, not to determine the package name from a file path.
Concept tested: RPM package query by file
Source: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/chap-rpm_and_yum#sec-Querying_RPM_Packages
Topics
Community Discussion
No community discussion yet for this question.