Resolving Dependencies

Ramin Rad raminsrad at
Thu Jul 14 14:17:09 UTC 2011

The dependencies in RPM are only meaningful when it comes to packages 
(and virtual resources) that are in the RPM DB.

If you say "Requires:", RPM thinks there is another RPM 
package called that has to be installed prior to this and 
it checks its database and it doesn't find it, hence the error.

What you really want is file dependency. I am not sure if RPM supports 
that, but you can simply put something like this in your "%pre" section:


if [ ! -e /usr/lib/ ]
   echo "ERROR: /usr/lib/ doesn't exist! Bailing out."
   exit 1

# end of %pre

You can write as much script as you want in the %pre section and do all 
sorts of thing before your package is actually installed.

I hope this helps,

On 7/14/2011 10:02 AM, kali c wrote:
> Hi,
> I have my application which I want to build a rpm package. The 
> application has some dependencies that has to be installed. It 
> requires few  .so files that has to be present in the application 
> running machine. Say for e.g The command ldd reveals 
> other dependencies as well. I tried giving those dependencies in the 
> SPEC file under the requires field as Requires: ....
> I have also added the in the %files section with the 
> absolute path. I can build the SPEC file to .rpm without any errors.
> But I am getting errors regarding those dependencies while installing 
> them.
> Specifically error: Failed dependencies:
> is needed by myApplication-1.0-1.x86_64
> How I can specify in my SPEC file such that I can install those 
> dependencies even if they are not present in the target system? I need 
> this because not all the dependencies will be available in the target 
> system so that I can specify in some way so that either the entire 
> packages get installed or the required .so files are referred by the 
> application appropriately while installing my application.
> I am quite new to RPM so sorry if the question is a very basic one.
> -- 
> Regards,
> Kali
> _______________________________________________
> Rpm-list mailing list
> Rpm-list at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Rpm-list mailing list