rpm在哪里查找依赖关系? [英] Where does rpm look for dependencies?

查看:239
本文介绍了rpm在哪里查找依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我使用rpmbuild构建的rpm。让我们说它是sample.rpm。
它成功构建。 rpm有和可执行的(我们称之为init)。



当我尝试使用 rpm -ivh sample.rpm 它显示我失败的依赖关系。



我们假设错误是失败的依赖关系:example.so which意味着rpm无法找到此共享对象文件。 (即使这样的文件存在于同一个目录中)



所以,我将rpm安装为$ code rpm -ivh sample.rpm --nodeps (因为我知道我有所需的文件)。



为什么rpm不能安装那些rpms?
在哪里查找对象文件? (linux加载程序找到这些.so)。我有LD_LIBRARY_PATH来包括这些.so的路径,所以当我从运行的rpm运行安装的文件(init)。



那为什么rpm不能安装sample.rpm(它究竟在哪里找到依赖关系)?
这是在rpm建立时需要指定的东西?

解决方案

RPM文件在需求:行上的 .spec 文件中指定。



样品SPEC文件: / h3>



 摘要:<我的Linux项目摘要> 
名称:<我的Linux项目的名称>
版本:2.5.1
发布:GA
需要:libx1.so> = 2.6.3
BuildArch:i586
组:系统/应用程序
许可证:GPL 2.0
供应商:<我的组织>

您还可以运行此命令来确定需要哪些依赖关系:

  $ rpm -q --requires< my_rpm> 
libx1.so.2
$

依赖关系 libx1.so 本身应该通过RPM安装,以便它的存在被输入到由RedHat软件包管理器维护的数据库中。换句话说,文件系统上的 libx1.so 的实际存在不是依赖性测试的标准。



要找出哪个包提供依赖关系,请运行以下命令:

  $ rpm -q - 什么提供libx1 

如果没有包提供 libx1.so ,除非您从Requires:行中删除 libx1.so ,否则RPM将继续显示依赖关系错误。



要禁用自动检测依赖关系,可以将其添加到您的 .spec 文件中:

  AutoReqProv:no 

更多信息请参见 rpm.org rpm5.org


I have an rpm which I have build using rpmbuild. Lets say it is sample.rpm. It builds successfully. The rpm has and executable (let's call it init).

When I try to install it using rpm -ivh sample.rpm it shows me failed dependencies.

Let's say the error is Failed dependency for: example.so which means that rpm is not able to locate this shared object file. (even though the so file exists in the same directory).

So, I install the rpm as rpm -ivh sample.rpm --nodeps (as I know that I have the required so files).

Why is rpm not able to install those rpms then? where does it look for the object files? (does the linux loader looks for these .so). I have LD_LIBRARY_PATH to include path to these .so and so when I run the installed file (init) from the rpm it runs.

Then why is rpm not able to install sample.rpm (where exactly does it look for dependencies)? Is it something that needs to be specified at the time when the rpm is build?

解决方案

The dependencies of an RPM file are specified in its .spec file on the "Requires:" line.

Sample SPEC file:

Summary: <Summary for my Linux project>
Name: <Name for my Linux project>
Version: 2.5.1
Release: GA
Requires: libx1.so >= 2.6.3
BuildArch: i586
Group: System / Applications
License: GPL 2.0
Vendor: <my organization>

You can also run this command to determine which dependencies are required:

$ rpm -q --requires <my_rpm>
libx1.so.2
$

The dependency libx1.so itself should be installed through an RPM, so that its presence is entered in a database maintained by the RedHat Package Manager. In other words, the physical presence of libx1.so on the file system is not the criteria for the dependency test.

To find out which package provides the dependency, run the command:

$ rpm -q --whatprovides libx1

If no package provides libx1.so, your RPM will continue to show a dependency error unless you remove libx1.so from the "Requires:" line.

To disable automatic detection of dependencies, you can add this to your .spec file:

AutoReqProv: no

A lot more information is at rpm.org and rpm5.org.

这篇关于rpm在哪里查找依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆