Solaris Package Companion

There is just so much to say and so very little time to say it. Today, I would like to steal away a few minutes to announce a new tool that I had created recently while working on some minimization efforts. I finally got completely sick and tied of having to mine through the .clustertoc, pkgmap, and depend files for everything that I needed. So, being an engineer at heart, I eliminated complexity through automation! ;-)

Without further ado, please allow me to introduce you to the Solaris Package Companion (or SPC). SPC allows you to ask quite a number of interesting questions about the relationships between Solaris metaclusters, clusters and packages as well as their dependencies. Certainly useful for those considering deploying reduced or minimal Solaris OS installations which is why I wanted to share this new tool with you.

The goal of SPC is to do all of the hard work, trolling through the various packaging files and directories in order to create a small cache that allows you to quickly and easily obtain answers to a variety of questions such as:

   To display the list of packages contained in the specified cluster(s).
   -c [package cluster list]

   To display the metacluster(s) that contain the specified cluster(s).
   -C [package cluster list]

   To display the dependencies for the specified package(s).
   -d [package list]

   To display the dependencies for the specified cluster(s).
   -D [package cluster list]

   To evaluate install packages on a system against a specified metacluster.
   -e [meta cluster]

   To display the packages contained in the specified metacluster(s).
   -m [meta cluster list]

   To display the clusters contained in the specified metacluster(s).
   -M [meta cluster list]

   To display the cluster that contains the specified package(s).
   -p [package list]

   To display the metacluster(s) that contain the specified package(s).
   -P [package list]

   To display the list of packages that depend on the specified package(s).
   -z [package list]
Upon first invokation, the tool creates a small cache (called the repository) whose location is determined by the -r command line option. The size of this cache is rather small, typically around four or five Mbytes. The time that it takes to create this cache will vary, but in my testing it was about four to five minutes. Believe me, this is a small price to pay for the speed once the cache is created. Note that you should avoid using SPC over NFS links as that will increase the time it takes to create the initial cache.

SPC supports several general options:

   -h, -?       [show help]
   -l           [local mode - use local system repositories and data]
   -r           [repository location]
   -s           [solaris distribution location]
   -v           [show package details]
Local mode simply uses the current system as its source of information rather than a separate installation image (as would be specified by the -s option. The -r option, discussed earlier, specifies the location of the SPC repository or cache. The -v option is your typical verbose mode that provides descriptions for each of the metaclusters, clusters and packages listed.

So, now that you get the basics, let's show some of this in action. The first thing we will do is display the package dependency listing for the SUNWsshdu package:

$ ./spc-v0.4.ksh -r /tmp/gmb -s /export/install/images/s10u1/Solaris_10/Product -v -d SUNWsshdu
SUNWcakr                  Core Solaris Kernel Architecture (Root)
SUNWcar                   Core Architecture, (Root)
SUNWckr                   Core Solaris Kernel (Root)
SUNWcnetr                 Core Solaris Network Infrastructure (Root)
SUNWcsd                   Core Solaris Devices
SUNWcsl                   Core Solaris, (Shared Libs)
SUNWcsr                   Core Solaris, (Root)
SUNWcsu                   Core Solaris, (Usr)
SUNWgss                   GSSAPI V2
SUNWgssc                  GSSAPI CONFIG V2
SUNWkvm                   Core Architecture, (Kvm)
SUNWopenssl-libraries     OpenSSL Libraries (Usr)
SUNWsshcu                 SSH Common, (Usr)
SUNWsshdr                 SSH Server, (Root)
SUNWzlib                  The Zip compression library
Another interesting question is to ask which packages depend on a specified package, in this case SUNWzlib:

zoey:/tmp 143 $ ./spc-v0.4.ksh -r /tmp/gmb -v -z SUNWzlib
[....many more entries removed for brevity...]
Note that once the repository is created, you do not need to specify the -s option.

Well, that is it for now. I have another tool that I want to post and I hope to do so in the next day or two. At any rate, I would love to hear from people who use this tool or find it interesting. As always, if you find a bug or think up a cool enhancements, please drop me a note as well.

Take care,


Technorati Tag:


It is not kind to tease us so! The link you posted points to, but the link there gives a 404 error.

Posted by Mike Gerdts on June 22, 2006 at 11:27 AM EDT #

Mike, if you reload the page, you should be able to get to the promised code. Thanks for letting me know about the 404! I think I may have stumbled across a bug on the mediacast site. Thanks again. Take care, Glenn

Posted by Glenn Brunette on June 22, 2006 at 11:47 AM EDT #

Hi Glenn, This is a super super useful utility. Would it be possible to get this added to the Solaris package tools? It would be swell to have this utility installed by default. Thanks for sharing this with the community, - Ryan

Posted by Matty on June 23, 2006 at 03:12 AM EDT #

Hi Glenn, First and foremost awesome tool. Here's a nitpick: when invoking with the -r option, I made the assumption that the repository argument should be a directory rather than a file. In this scenario SPC dies silently. Only after printf'ing the script did I realize the error of my ways. Ahh, it's probably just me.

Posted by Jim Connors on June 28, 2006 at 03:45 PM EDT #


Thank you very much for your feedback! I am very happy you found the tool helpful. You are right however that its exception handling could use a bit of work. I will definitely try to improve that for a future revision. Also, you were right that the repository argument is a directory. If the directory already exists, SPC will just exit however - which is the behavior that I believe you saw. I will be sure to post when a new version is ready.

Thanks again for your comments!


Posted by Glenn Brunette on June 29, 2006 at 08:36 AM EDT #


Thank you! I was hoping that people would be able to put it to good use. I figured that I must not be the only one who had struggled with clusters and packaging. As far as your comment with getting a tool like this into Solaris, I would like to ask you if you could file an RFE for this functionality at the OpenSolaris site. It is always a plus when an external (to Sun) customer makes the request rather than it being from within.

If you do file the RFE, please drop me a note with the identifier so that I can track it.

Thanks again for your comments and words of support!


Posted by Glenn Brunette on June 29, 2006 at 08:41 AM EDT #

Post a Comment:
Comments are closed for this entry.

This area of cyberspace is dedicated the goal of raising cybersecurity awareness. This blog will discuss cybersecurity risks, trends, news and best practices with a focus on improving mission assurance.


« August 2016