I'm not sure if its the recommended approach or not, in case the user doesn't have web access, and my software requires, lets say: libgcc- (for e.g), I would like to bundle this for the specific supported os (e.g: RHEL 5.10) and all of its dependencies in a single .rpm.

whats the best approach for this?


3 Answers 3


It would be tricky to bundle all the dependencies into a single RPM, not least because the system you build on may have a different package composition from your target (e.g., your target has newer, or conflicted packages already installed, which you may unintentionally overwrite).

However, you could instead obtain a list of all prerequisite packages and install them all at the same time.

Assuming that you have two systems (build and target) which are the same flavour and release (e.g., making a package list on CentOS 6, for CentOS 6), try something this:

$ sudo yum install yum-utils # not necessary on the target
$ mkdir package-bundle
$ yumdownloader --destdir package-bundle `repoquery --resolve --requires $PACKAGE_NAME`
$ tar -czvf package-bundle.tar.gz package-bundle

On the target system:

$ tar -xzvf package-bundle.tar.gz
$ sudo yum install package-bundle/*.rpm

The above uses repoquery instead of relying on yumdownloader to resolve the dependencies, as yumdownloader does not appear to recursively resolve when the --resolve flag is set.


I think what you are looking for should be to statically compile the application. This will make it very unlikely that the user will get any dependencies that are not available for them already.

  • That could result in an app as big as the entire distro, depending on the prerequisites required. But it is also my inclination so I up-voted.
    – Dani_l
    Commented Aug 9, 2014 at 23:20

You don't need to bundle dependencies. If the end user doesn't have Internet access, that's their problem. Such places have a variety of methods for dealing with this, such as using the installation media to install and update packages, maintaining a local mirror of the distro, etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .