installing an rpm from another rpm's %post script

Florian Festi ffesti at
Fri Jan 23 07:27:58 UTC 2009

Derek Atkins wrote:
> Hey rpm-ers,
> I'm trying to create an RPM package that contains other RPM
> packages and installs those sub-packages as part of the %post
> script.   However when I try this I get a lock failure:
> warning: waiting for transaction lock on /var/lib/rpm/__db.000
> Is there some way to do a recursive RPM install?
> For more details:
> When you run "rpm -U foo.rpm" it installs a bunch of RPM files.
> So foo.rpm installs /usr/lib/foo/packages/foo-{1,2,3}.rpm
> Then in the foo.rpm %post script I want to:
>   rpm -U foo-1.rpm foo-2.rpm foo-3.rpm
> Is there a good way to do this?

There are some good ways to install a collection of rpms. Packaging them 
into another rpm is none of them.

You can create a meta package - an rpm that requires the others but does not 
contain them. This has the disadvantage that the users still can't easily 
see which is the meta package and why it is there. Choosing a good name can 

The better solution would be to use the layer above rpm to solve this if you 
can specialize to a given distribution. You could create a yum repository 
with the rpms and put them into a yum group (assuming you package for a yum 
based distribution).

In the end you can still repackage the content of the rpms into one. If you 
don't have the source rpms you can extract the content with rpm2cpio and cpio.


More information about the Rpm-list mailing list