1. 程式人生 > >yum中查找程序由哪個包提供

yum中查找程序由哪個包提供

python ade sem plugins -s ror 解釋 提示 x86

有時候知道程序的名稱,卻不知道由那個包提供,也就是說不知道安裝那個包,可以使用這個命令。

我們由provides關鍵字可以使用。

舉例:semanage是SELinux的一個管理工具,可是我使用:yum install semanage

卻提示我沒有這個包。

祭出provides神器,反向查找:

yun provides semanage

輸出:

[[email protected] ~]# yum provides semanage
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base/7/x86_64/filelists_db | 6.6 MB 00:01
epel/x86_64/filelists_db | 8.0 MB 00:01
extras/7/x86_64/filelists_db | 925 kB 00:00
updates/7/x86_64/filelists_db | 3.3 MB 00:01
policycoreutils-python-2.5-8.el7.x86_64 : SELinux policy core python utilities
Repo : base
Matched from:
Filename : /usr/sbin/semanage

policycoreutils-python-2.5-9.el7.x86_64 : SELinux policy core python utilities
Repo : updates
Matched from:
Filename : /usr/sbin/semanage

policycoreutils-python-2.5-11.el7_3.x86_64 : SELinux policy core python
: utilities
Repo : updates
Matched from:
Filename : /usr/sbin/semanage

現在知道了:由policycoreutils-python這個包包提供。

yun install pollicycoreutils-python

搞定。

附加:官方對provides的解釋,它還有一個別名whatprovides:

provides or whatprovides
Is used to find out which package provides some feature or file. Just use a specific name or a file-glob-syntax wildcards to
list the packages available or installed that provide that feature or file.

yum中查找程序由哪個包提供