Find a package providing /usr/sbin/semanage, including packages not installed locally.
The package name is unknown.
Which command is appropriate?
yum provides PATH searches repository metadata for packages containing the specified file or capability.
Detailed explanation
yum search /usr/sbin/semanageIncorrect. search matches names or descriptions, not file ownership.
Incorrect. search matches names or descriptions, not file ownership.
yum info /usr/sbin/semanageIncorrect. info expects a package name rather than a file path.
Incorrect. info expects a package name rather than a file path.
yum list /usr/sbin/semanageIncorrect. list filters package lists and does not reverse-lookup file providers.
Incorrect. list filters package lists and does not reverse-lookup file providers.
yum provides /usr/sbin/semanageCorrect. yum provides /usr/sbin/semanage finds the supplying package.
Correct. yum provides /usr/sbin/semanage finds the supplying package.
Try it yourself
An example you can run in a temporary verification environment.
yum provides /usr/sbin/semanageExpected result
該当パッケージの名前、版、リポジトリ、Matched from等の表示Key points
- provides reverses path to package
- Uninstalled packages are searchable
- Repository metadata is used
Notes
- Environment: YUM 3.xまたは互換YUM / 読み取り操作
- 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.