By MandyWaite on Oct 29, 2009
The OpenSolaris /contrib package repository has a whole bunch of packages contributed by members of the OpenSolaris community or just by those who had a particular need for a certain package and who decided to submit it themselves.
You can install any of these packages either using the pkg command or via the package manager, you can even just go to the /contrib repository's catalog page and click on the 'install' link for the package(s) that you want to install.
To set up /contrib as a valid publisher for use with the package manager or the pkg command do the following as a user with the root role (or Software Installation profile):
pfexec pkg set-publisher -O http://pkg.opensolaris.org/contrib contrib
Or you can add /contrib via the package manager through the File -> Manage Repositories pull down. If installing from the "install" link at http://pkg.opensolaris.org/contrib/en/catalog.shtml the package manager will automatically add /contrib to the list of publishers.
To install packages using pkg, do the following:
pfexec pkg refresh
pfexec pkg install <package name>
You don't have to run 'pkg refresh' before installing every package, but it is probably best to do it reasonably regularly just to make sure that pkg has an up to date view of the repositories that it knows about.
There is also a /pending repository which is used to stage packages for testing while they are being made ready for promotion to /contrib. I wouldn't recommend arbitrarily using packages from /pending but you may want to provide feedback on a package, or as in the case with the ruby-mysql package, it maybe that the owner has suggested that you get it from /pending due to some issue getting it into /contrib.
To setup /pending as a publisher, you do much the same as you do for /contrib:
pfexec pkg set-publisher -O http://jucr.opensolaris.org/pending pending
Or use the package manager File -> Manage Repositories menu.
To list the repositories that pkg knows about, run:
% pkg publisher
PUBLISHER TYPE STATUS URI
opensolaris.org (preferred) origin online http://pkg.opensolaris.org/ contrib origin online http://pkg.opensolaris.org/contrib/ pending origin online http://jucr.opensolaris.org/pending/ mypkgs origin online http://localhost:80/ webstack origin online http://pkg.opensolaris.org/webstack/
If you have both /contrib and /pending added as publishers, when you install packages you'll need to qualify the package name with the name of the publisher from which you want to install it as follows:
pfexec pkg install pkg://pending/ruby-mysql
Which will install the 'ruby-mysql' package from the publisher name pending. Note that this is the publisher name, not the URI of the repository.
In the list of repositories above are a couple of other repositories that we've not talked about. The /webstack repository has packages that the WebStack team feel might be useful, but for which they are unable to offer support. This has packages for Web Tier applications such as Varnish and Nginx. We also sometime publish packages that are in the process of being integrated into OpenSolaris but are not yet available in the main repositories. The mypkgs repository is a repository local to our test system. It is very easy to set up a build environment for building your own packages from Spec files and then to publish them to a local repository. If you're going to do that though, you might as well publish them to /contrib via SourceJuicer.
Here's some other links that you might find useful:
The Genunix site has a page describing how to setup a SourceJuicer like environment