For a server in an offline environment, how would I download a package from http://pkg.openindiana.org/dev? (or the better known http://pkg.oracle.com)
There is an install link which downloads a p5i
file, with machine readable download information, but there is no http URL to the downloadable package file(s) or the listing of files.
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:
Say for example, you're interested in testing the latest version of a package. Then do something like this:
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
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.
A package in an IPS repository only makes sense within the context of actually installing the package via the pkg(1) command over the network. A package is not represented as a single file within an IPS repo; instead, the manifest file for a package keeps track of the various bits. My understanding is that this allows for efficient upgrades since only changed files need to be transferred.
One option is to mirror the IPS repository to the local system or to another system that is accessible. There are instructions at the old OpenSolaris site and on OpenIndiana's wiki. It has been a while since I mirrored an IPS repo, however, so I cannot comment on the accuracy of the instructions at those links.
There are likely other options, but I don't know them off the top of my head.
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
Create a local package repo:
Grab packages from remote repo:
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:
Start a
pkg.depotd
instance so thatpkg
can use it:(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:
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.
Each individual file in IPS is compressed using
gzip
, so you can manually usecurl
andgzip -dc
to pull down and uncompress the file.For example: fetching
sccsdiff
(file sha1 hashb8dac4eaeabc7d41b4bff842a2f6b54cb36449d7
) as mentioned by George Bailey...You can also verify the sha1 hash of the uncompressed file...
More information available on the OmniOS wiki: Fetching IPS Package Files Without pkg(1)
I have created a portable utility to do such things:
http://www.bolthole.com/solaris/ipsutil/README