How does one update Ruby in OpenSolaris?

  The package manager UI(or it's command line alternative "pkg" ) in OpenSolaris is the right way to update installed programs.  However, in 2008.11 (and onward) one may find that the package manager does not show that updates are available.  This is because of how the package repositories for OpenSolaris are structured.

 The package manager by default uses the package repository at   This repository is frozen(this is not completely true, since we're allowed to put security patches into the release repository after it's been 'frozen', but new features and other bug fixes are not allowed here) at the time of an OpenSolaris release and is updated only when the next official release occurs.  The 6 + builds that occur before the next freeze(for the next release) are not reflected in this repository. 

 It's a pity - with OpenSolaris, you don't have to worry about build instabilities, crashes etc., given all the good quality assurance that's built into the system - so one might(and probably would) prefer to stay on the latest build without giving up on stability. 

 But have no fear, there is an option for such users - the dev repository.  Please set  as one of your repositories(in the package manger tool).  In fact, I also set it to be my primary repository.  This way you can stay up to date, without waiting for the next official release; the dev repository is updated with every build.  So expect an update every two weeks(approximately).

To update the installed Ruby, click on the "Update all" button - this will download a wad of packages to update your system with.  The update takes a while, but this happens in the background while you continue working.  For other programs you may be able to get away with updating only the concerned package.


Hi Prashant,

You wrote "this repository is frozen at the time of an OpenSolaris release and is updated only when the next official release occurs."

Although new features and new versions of software are not likely to show up in the /release repository, it isn't frozen. The plan is to provide security updates and critical bug fixes in /release. So far, for 2008.11, we haven't had any such updates.

The repositories are explained here

So hopefully, if there were say security vulnerabilities in Ruby, we'd get updates in /release.

Posted by Haik on February 04, 2009 at 08:56 AM PST #

Can you update only ruby? How do I do it on the command line?

Posted by neel on February 04, 2009 at 10:28 AM PST #

@Haik - you're right. We do allow security fixes. This system was created around 2008.11 - so wasn't as useful during the early patch releases of 1.8.6.

You can count on Ruby security fixes bring in /release - if I can help that at all.

@Neel - Hey. Yes, you can use the command line as well - just use pkg set-authority and image-update. Check out pkg(1) -

I don't believe you can update only Ruby - we specify a lot of system packages as dependencies, and since the dev repository has all packages available, your IPS client is probably going to upgrade the dependencies(and theirs) to their new version - irrespective of whether they have changed. Now I haven't actually verified this, but it seems likely.

Posted by Prashant Srinivasan on February 04, 2009 at 02:02 PM PST #

I hate to rant here, but isn't "pkg image-update" require a reboot before the new "be" can be activated? Are we supposed to reboot just to get a newer version of ruby? :-(

Posted by neel on February 05, 2009 at 02:01 AM PST #

@neel - "pkg image-update" can be run, but no it is not required.

If you use the Package Manager GUI, not to be confused with the Update Manager GUI, you can simply check the box for the Ruby package and click the button labeled "Install/Update". This will install the package into your active boot environment as you would expect from a typical package manager.

From the shell, you would have to issue the commands "pkg refresh ; pkg install <pkg_fmri>". If you already have ruby installed, after running "pkg refresh", a "pkg list -u" should list any available updates.

I wouldn't want to run the image-update command to upgrade a single package. However, if there were a lot of new package versions, I might use image-update so I could revert back to the old boot environment if the new packages broke something important to me. And yes, switching boot environments requires a reboot.

Posted by Haik on February 05, 2009 at 03:17 AM PST #

Post a Comment:
Comments are closed for this entry.



« July 2016