简体   繁体   English

检查RPM依赖项

[英]Check RPM dependencies

When you are installing a programming using .deb packages on Ubuntu, you can check dependencies of package using Ubuntu Packages Search . 在Ubuntu上使用.deb软件包安装编程时,可以使用Ubuntu软件包搜索来检查软件包的依赖关系。 For example I can see dependencies of Wireshark from here . 例如,我可以从这里看到Wireshark的依赖关系。 As you can see, dependencies marked by red bullet. 如您所见,依赖项由红色子弹标记。 If you know all packages your program depends them, you can download them and installing dpkg . 如果您知道程序所依赖的所有程序包,则可以下载它们并安装dpkg

Is there any alternative web site for RPM packages? 是否有任何替代RPM包的网站? Specially for RHEL? 特别为RHEL?

I know that I can get these packages's name by other methods such as when installing RPM package using rpm -i , but it is not user friendly and needs access to running linux. 我知道我可以通过其他方法获取这些软件包的名称,例如使用rpm -i安装RPM软件包rpm -i ,但它不是用户友好的,需要访问运行的linux。

In fact that's not a one but four different questions :). 事实上,这不是一个而是四个不同的问题:)。

*) First you can quickly list a downloaded package's dependencies/requirements by using the following commands: *)首先,您可以使用以下命令快速列出下载的软件包的依赖项/要求:

$ rpm -qp mypackage.rpm --provides
$ rpm -qp mypackage.rpm --requires

*) Second, you can use yum utility in order to satisfy these (somewhat cryptic) dependencies automatically (assuming that all your repositories are set up correctly, and all the dependencies are available): *)其次,您可以使用yum实用程序来自动满足这些(有些神秘的)依赖关系(假设您的所有存储库都已正确设置,并且所有依赖项都可用):

$ sudo yum install mypackage.rpm

*) Third, there are several RPM search resources, some of them already suggested above. *)第三,有几个RPM搜索资源,其中一些已在上面提出过。 I'd like to list another one, just for the reference - pkgs.org . 我想列出另一个,仅供参考--pkgs.org

*) Fourth, there is an additional popular repository for RHEL5 and RHEL6 distros - EPEL . *)第四,RHEL5和RHEL6发行版还有一个更受欢迎的存储库--EPEL Note that it's not supported by Red Hat. 请注意,Red Hat不支持它。

Hope my answer(s) will help. 希望我的回答会有所帮助。

To merely list all dependencies of a package on the command-line, here is an example which builds upon the answer by Peter: 要仅列出命令行中包的所有依赖关系,这里有一个基于Peter的答案的示例:

$ PKG="http://yum.postgresql.org/9.3/redhat/rhel-6.2-x86_64/pgdg-sl93-9.3-1.noarch.rpm"

Using yum (recommended): 使用yum (推荐):

$ yum -q deplist $PKG
package: pgdg-sl93.noarch 9.3-1
  dependency: sl-release
   Unsatisfied dependency
  dependency: /bin/sh
   provider: bash.x86_64 4.1.2-8.el6
  dependency: config(pgdg-sl93) = 9.3-1
   provider: pgdg-sl93.noarch 9.3-1

-q above is of course optional and is equivalent to --quiet . -q当然是可选的,相当于--quiet

Using rpm : 使用rpm

$ rpm -qpR $PKG
/bin/sh  
config(pgdg-sl93) = 9.3-1
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
sl-release  

-qpR above is equivalent to --query --package --requires . 上面的-qpR相当于--query --package --requires

This site http://www.rpmfind.net/linux/RPM/ provides a search engine for rpm files. 该站点http://www.rpmfind.net/linux/RPM/为rpm文件提供搜索引擎。 You can see dependencies and description. 您可以看到依赖关系和描述。 It also classifies them per distro. 它还根据发行版对它们进行分类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM