我們拿pip命令來舉例
方法一:
確認命令的路徑
# which pip
/usr/bin/pip
用yum命令查找pip屬於哪個rpm包
# yum whatprovides /usr/bin/pip
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.sina.cn
* epel: mirrors.ustc.edu.cn
* extras: mirrors.zju.edu.cn
* updates: mirrors.zju.edu.cn
python-pip-7.1.0-1.el6.noarch : A tool for installing and managing Python packages
Repo : epel
Matched from:
Filename : /usr/bin/pip
python-pip-7.1.0-1.el6.noarch : A tool for installing and managing Python packages
Repo : installed
Matched from:
根據上述信息,可知pip來自python-pip-7.1.0-1.el6.noarch這個包.
另外yum provides/whatprovides接受通配符選項:
假如不知道命令的路徑,也可以用通配來解決
yum whatprovides *pip
關於yum的其它用法可以man yum查看
方法二:
確認命令的路徑
# whereis pip
pip: /usr/bin/pip2.6 /usr/bin/pip
查找命令屬於那個安裝包
# rpm -qf /usr/bin/pip
python-pip-7.1.0-1.el6.noarch
列出這個rpm包中的所有文件
# rpm -ql python-pip-7.1.0-1.el6.noarch
查詢是否安裝某個rpm包.
rpm –qa python-pip
