How to manually download individual files from the OpenIndiana (or Solaris) pkg repo?

IPS clients can only install packages from IPS repositories. So, if you're not interested in adding the remote repository as a publisher, fortunately there is another option, which is to create an IPS archive (p5p).

Keep in mind an IPS archive is not like a Linux RPM. You cannot for example install software directly from an IPS archive. But you can copy the file to other systems, such as a non-networked system. Think of an IPS archive as a portable repository because that's how you'll be using it. It's only after you create a local repository from the IPS archive file, can you then consume packages from it.

IPS archives allow you to:

  • Download one or more packages (along with all necessary dependencies) into a p5p archive file.
  • Create a local repository based on the contents of the p5p archive file.
  • Install packages from the locally created repository.

Say for example, you're interested in testing the latest version of a package. Then do something like this:

pkgrecv -s http://example.com:10000 -d ~/firefox_test.p5p -a -r pkg://userland/web/browser/[email protected]:20160817T064143Z

Check the contents of the package with: pkgrepo -s ~/firefox_test.p5p list or you can use: pkg list -f -g ~/firefox_test.p5p

Add the IPS archive as a local repository with: pkg set-publisher -p ~/firefox_test.p5p

And finally to install a specific version of firefox, do use: pkg install [email protected]:20160817T064143


The manifest is directly available http://pkg.openindiana.org/dev/manifest/0/developer%2Fbuild%2Fmake%400.5.11%2C5.11-0.151.1%3A20110912T022544Z.

The only thing that remains is to figure out how to get those individual files, listed in this fashion

file b8dac4eaeabc7d41b4bff842a2f6b54cb36449d7 chash=f3998eb4b0aa99b3c54682f1a765e19215e15622 group=bin mode=0755 owner=root path=usr/bin/sccsdiff pkg.csize=1620 pkg.size=3798
file 9b1eb9d425c9de60eba5759368160e709fb51143 chash=0de4a47b23c1ac5121c9216ec854b197c18bfe24 group=bin mode=0644 owner=root path=usr/lib/help/locale/C/ad pkg.csize=2201 pkg.size=5762
file 0f594094532464eab978e00d4d3e18519538fe7b chash=e6685b5da6534ef06ad4aa51c4655fe72f98a2f1 group=bin mode=0644 owner=root path=usr/lib/help/locale/C/bd pkg.csize=1082 pkg.size=2089
file a0d207452b8fa6dd62661cd8349fe92ae415de10 chash=67fd628d7578b7fd907eb75b973c91aeb7b06fee group=bin mode=0644 owner=root path=usr/lib/help/locale/C/cb pkg.csize=805 pkg.size=1498
file 6267fe29483aaffdd5ca7dadab0866e3c23024f5 chash=d769eee8c86a2aefb0af1abb6d55dd559b26864e group=bin mode=0644 owner=root path=usr/lib/help/locale/C/cm pkg.csize=1581 pkg.size=3341
file 18691bfa26474c1133b6ac55897f15bba8cf669a chash=55a97bca8ce191bae3621ace062f3192bf0def18 group=bin mode=0644 owner=root path=usr/lib/help/locale/C/cmds pkg.csize=2279 pkg.size=6573
file 614eef6da7707fa4c77e5a0c958ec42eb1f7c68c chash=36df818d773e392d585fd58cf65d3dab93466528 group=bin mode=0644 owner=root path=usr/lib/help/locale/C/co pkg.csize=2284 pkg.size=5010
file 50e3e4dd1731dd07e7633afab6da1825527a312d chash=8e98dd2c2a45cc35993e3c373ecace197b65e900 group=bin mode=0644 owner=root path=usr/lib/help/locale/C/de pkg.csize=2108 pkg.size=4651

Edit: Individual files can be downloaded with a URL like this example: http://pkg.openindiana.org/dev/file/0/b8dac4eaeabc7d41b4bff842a2f6b54cb36449d7

Only one thing remains. How to install these files.


The easiest way is to use pkgrecv to pull the package from a source repository to a local repository. IPS is a network package system so you can't currently install packages from a single file like you could with SVr4 datastreams. Last I heard (before the Oracle takeover) was that the pkg5 guys were working on an on-disk format but I don't think it got finalised. I can check with one of the developers if you like though. Anyway, that's by the by.

What you need to do

  1. Create a local package repo:

    pkgrepo create /path/to/localrepo
    
  2. Grab packages from remote repo:

    pkgrecv -s http://pkg.openindiana.org/dev -d /path/to/localrepo <FMRI_or_glob_of_packages>
    

It's been a while since I did this (last time was when OpenSolaris was on the verge of shutdown and we [OpenIndiana team] were grabbing packages from OpenSolaris /dev) but you might need to set the publisher of your local repo to be the openindiana.org publisher:

pkgrepo set -s publisher/prefix=openindiana.org /path/to/localrepo

Start a pkg.depotd instance so that pkg can use it:

pkg.depotd -d /path/to/localrepo -p 10000

(You probably want to set this up in SMF. Follow the howto on the OpenIndiana wiki.)

Then add your local repo as an origin of openindiana.org:

pkg set-publisher -g http://localhost:10000 openindiana.org

And finally...

No, there really isn't an easier way of doing this. This is one of the reasons I don't like the move to IPS.