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.
yum info /usr/sbin/semanageIncorrect. 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.
yum provides /usr/sbin/semanageCorrect. 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 / 読み取り操作
- Use a disposable system or transaction preview before package changes.
- YUM compatibility layers can expose different subcommands across distributions.
Foundation review
Place the operation
A provider query can identify an uninstalled package when repository file metadata is available.
Check the side effect
Refresh metadata if the provider index is missing or stale.