You do not know which package provides /usr/bin/semanage.
Search enabled YUM repositories, including packages that are not installed.
Which command is appropriate?
yum provides searches repository metadata for packages that provide a file or capability. rpm -qf is limited to files in the local installed database.
Detailed explanation
rpm -qf /usr/bin/semanageIncorrect. rpm -qf searches only installed package ownership.
Incorrect. rpm -qf searches only installed package ownership.
yum list /usr/bin/semanageIncorrect. yum list lists package versions and does not perform a file-provider search.
Incorrect. yum list lists package versions and does not perform a file-provider search.
yum info /usr/bin/semanageIncorrect. yum info displays package details after a package is identified.
Incorrect. yum info displays package details after a package is identified.
yum provides '*/semanage'Correct. yum provides '*/semanage' searches repository metadata for the provider.
Correct. yum provides '*/semanage' searches repository metadata for the provider.
Try it yourself
An example you can run in a temporary verification environment.
yum help providesExpected result
providesサブコマンドの使用法。ネットワーク検索は行わないKey points
- provides searches repositories
- A glob can describe a path
- This is broader than rpm -qf
Notes
- Environment: YUM 3.x/DNF互換YUM CLI
- 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.