Linux查看包依赖关系的神器-repoquery分享

  RPM 安装第三方包的时候,经常会遇到依赖缺失问题;
  这对于新手朋友们就不这么友好了,甚至不知所措;
  在此推荐个依赖包关系查询工具 repoquery;
 
  说明:repoquery是yum扩展工具包yum-utils中的一个工具,所有如果你没有repoquery命令的话,可以先 sudo yum install yum-utils 安装yum-utils包。是为了加强和补充yum功能的工具,重点是查询包的关系。repoquery的官方说明是:query information from Yum repositories,故名意思,它只能查看信息,并不能执行安装卸载更新等实质性的操作。而且要和Yum库配合使用。
 
实际生产环境中经常出现的例子: 
安装Chrome浏览器
rpm -ivh google-chrome-stable_current_x86_64.rpm
如果出现下面错误消息,则表明缺少依赖包:
[root@lenmomDesktop Downloads]# rpm -ivh google-chrome-stable_current_x86_64.rpm
warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
error: Failed dependencies:
    libXss.so.1()(64bit) is needed by google-chrome-stable-67.0.3396.87-1.x86_64
     libappindicator3.so.1()(64bit) is needed by google-chrome-stable-67.0.3396.87-1.x86_64
    libnss3.so(NSS_3.22)(64bit) is needed by google-chrome-stable-67.0.3396.87-1.x86_64
    libssl3.so(NSS_3.28)(64bit) is needed by google-chrome-stable-67.0.3396.87-1.x86_64
 
针对错误消息中的每个依赖包,执行命令repoquery --nvr --whatprovides   <依赖文件>,安装输出包, such as:
[root@lenmomDesktop Downloads]# repoquery --nvr --whatprovides   libappindicator3.so.1
libappindicator-gtk3-12.10.0-13.el7
[root@lenmomDesktop Downloads]# yum install -y libappindicator-gtk3-12.10.0-13.el7
发现亮点了吗?!!!
 

猜你喜欢

转载自www.cnblogs.com/illusioned/p/11915095.html