Linux 检查 RPM 依赖项

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19077538/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 00:57:28  来源:igfitidea点击:

Check RPM dependencies

linuxdependency-managementrpmrhel

提问by SuB

When you are installing a programming using .debpackages on Ubuntu, you can check dependencies of package using Ubuntu Packages Search. For example I can see dependencies of Wireshark from here. 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.

当您.deb在 Ubuntu 上使用软件包安装程序时,您可以使用Ubuntu Packages Search检查软件包的依赖关系。例如,我可以从这里看到 Wireshark 的依赖关系。如您所见,红色项目符号标记的依赖项。如果您知道程序依赖的所有软件包,则可以下载它们并安装dpkg.

Is there any alternative web site for RPM packages? Specially for RHEL?

有没有其他 RPM 包的网站?专门用于 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 包时rpm -i,但它对用户不友好并且需要访问运行 linux。

采纳答案by Peter Lemenkov

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 yumutility 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. I'd like to list another one, just for the reference - pkgs.org.

*) 第三,有几个 RPM 搜索资源,其中一些已经在上面建议了。我想再列出一个,仅供参考 - pkgs.org

*) Fourth, there is an additional popular repository for RHEL5 and RHEL6 distros - EPEL. Note that it's not supported by Red Hat.

*) 第四,还有一个额外的 RHEL5 和 RHEL6 发行版流行存储库 - EPEL。请注意,它不受 Red Hat 支持。

Hope my answer(s) will help.

希望我的回答会有所帮助。

回答by jabaldonedo

This site http://www.rpmfind.net/linux/RPM/provides a search engine for rpm files. You can see dependencies and description. It also classifies them per distro.

这个站点http://www.rpmfind.net/linux/RPM/提供了一个 rpm 文件的搜索引擎。您可以查看依赖项和说明。它还按发行版对它们进行分类。

回答by Acumenus

To merely list all dependencies of a package on the command-line, here is an example which builds upon the answerby 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

-qabove 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  

-qpRabove is equivalent to --query --package --requires.

-qpR以上相当于--query --package --requires.