我们拿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

相关文章:

  • 2021-04-25
  • 2021-11-08
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2021-05-12
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2021-06-28
  • 2021-09-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案