3

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-4.3.0.0.rpm (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?

thanks,

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.

| improve this answer | |
2

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.

| improve this answer | |
  • 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 Aug 9 '14 at 23:20
2

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.