Where does rpm look for dependencies?

I have rpm that I created using rpmbuild. Let's say this is sample.rpm. It works successfully. Rpm also has an executable file (call init).

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

Let's say the error is Failed dependency for: example.so , which means that rpm cannot find this file of shared objects. (although the file exists in the same directory).

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

Why can't rpm install these rpms? where is he looking for object files? (the linux loader is looking for these .so). I have LD_LIBRARY_PATH to include the path to these .so and so when I run the installed init file from rpm, it starts.

Then why can't rpm install sample.rpm (where exactly is it looking for dependencies)? Is this what you need to specify at the time of rpm build?

+8
dependencies rpm
source share
1 answer

The dependencies of the RPM file are listed in the .spec file in the "Required:" line.

Example 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 needed:

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

The libx1.so dependency libx1.so must be installed through RPM, so its presence is entered into a database maintained by RedHat Package Manager. In other words, the physical presence of libx1.so in the file system is not a criterion for a dependency test.

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

 $ rpm -q --whatprovides libx1 

If the package does not provide libx1.so , your RPM will continue to display a dependency error unless you remove libx1.so from the "Required:" line.

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

 AutoReqProv: no 

More information is available at rpm.org and rpm5.org .

+10
source share

All Articles