Inspect the capabilities and libraries required by the uninstalled archive example-2.0-1.x86_64.rpm.
Query the file directly without starting an installation transaction.
Which command is appropriate?
rpm -qpR FILE queries an RPM archive and displays its Requires entries. -p changes the query target from the installed database to the file.
Detailed explanation
rpm -qR exampleIncorrect. -qR queries requirements of an installed package named example.
Incorrect. -qR queries requirements of an installed package named example.
rpm -qf example-2.0-1.x86_64.rpmIncorrect. -qf searches ownership of an installed file path.
Incorrect. -qf searches ownership of an installed file path.
rpm -V example-2.0-1.x86_64.rpmIncorrect. -V verifies installed files and is not an archive dependency query.
Incorrect. -V verifies installed files and is not an archive dependency query.
rpm -qpR example-2.0-1.x86_64.rpmCorrect. rpm -qpR example-2.0-1.x86_64.rpm displays the archive's requirements.
Correct. rpm -qpR example-2.0-1.x86_64.rpm displays the archive's requirements.
Try it yourself
An example you can run in a temporary verification environment.
rpm --help | grep -E -- '--package|--requires'Expected result
package file選択とrequires表示の説明Key points
- -p queries an RPM file
- -R lists Requires
- No installation is performed
Notes
- Environment: RPM 4.19〜6.x公式仕様
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.