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


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

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

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

卻提示我沒有這個包。

祭出provides神器,反向查找:

yun provides semanage

輸出:

[root@noi ~]# 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.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM