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

  • 相关阅读:
    uc浏览器开发版
    探索.NET中的事件机制
    “多态枚举”数值如何判断?
    关于“程序集与命名空间”
    AutoResetEvent和ManualResetEvent的异同
    C# 获取DOS命令的返回值
    自定义控件——自绘
    关于using……的一些探讨
    XmlDocument操作xml类
    使用Trigger实现Cascading的功能
  • 原文地址:https://www.cnblogs.com/liuxia912/p/10962392.html
Copyright © 2011-2022 走看看