12

How can I extract the binaries out of a pkg file without adding them to the default locations under /usr or other default folder. I want to add this package under my own directory /our_own_directory/our_own_prefix_specific_for_this_package so it is self contained, easy to know what is going on, and is tied to our application directories instead of OS directories.

Also, I don't want to touch the global database of installed packages.

HopelessN00b
  • 53,954
700 Software
  • 2,273

1 Answers1

17

Though this won't install the package, you can transfer them from a package file (aka a datastream package) to a spool location with the pkgtrans command:

pkgtrans filename.pkg /home/user/existing_temporary_package_prefix_dir

This will extract the package file system hierarchy as well as the pkginfo file and any pre/post install scripts into your directory.

TCampbell
  • 2,054
  • Would it be necessary to execute any post install script using this strategy that bypasses standard package installation? – SAFX Feb 23 '23 at 22:57