zoukankan      html  css  js  c++  java
  • linux查找某个命令属于哪个rpm包

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

  • 相关阅读:
    第03组 Beta冲刺(1/4)
    第03组 Alpha事后诸葛亮
    第03组 Alpha冲刺(4/4)
    第03组 Alpha冲刺(3/4)
    第03组 Alpha(2/4)
    第03组 Alpha冲刺(1/4)
    第03组团队Git现场编程实战
    第二次结对编程作业
    团队项目-需求分析报告
    第01组 Beta冲刺(3/5)
  • 原文地址:https://www.cnblogs.com/liufarui/p/10962392.html
Copyright © 2011-2022 走看看