OpenCSW provides a software stack which allows to build catalogs with Solaris packages, and use a utility, such as pkg-get or pkgutil to download and install packages together with all the dependencies. It works very nice for OpenCSW packages, but what if one wants to install a SUNW, that is, a Sun-provided package? Solaris DVDs are not in the OpenCSW format and pkgutil can’t use them directly.
I wrote a tool which converts a collection of Sun packages in the directory format (they’re distributed this way) into a set of gzipped srv4 format files (.pkg.gz) which can be served over http or ftp and downloaded via pkgutil.
To get started:
- Install pkgutil and pkgutilplus from OpenCSW
- Check out the OpenCSW utilities:
svn co https://opencsw.svn.sourceforge.net/svnroot/opencsw/utilities/ - Have a Solaris DVD available in your filesystem
- Patch /opt/csw/bin/bldcat if necessary (the patch is there at the end of this post)
- Run the package converter:
./build_sun_catalog.py -p “/somewhere/Solaris_10/Product” -c “/target/directory/sparc/5.10″ - Run bldcat and create the catalog:
(cd /target/directory/sparc/5.10; bldcat .) - Server the target directory via http under, say http://packages.example.com/solaris-10u5
- From your Solaris machine, use the following command to install a package together with all the dependencies:
pkgutil -t http://packages.example.com/solaris-10u5 -i SUNWfoo
A word of warning though: upgrading SUNW packages can break your system! If you attempt to upgrade a core Solaris package such as SUNWcakr or SUNWkvm. If pkgutil tries to do that, use the -x option to filter out those packages. For example:
pkgutil -t http://packages.example.com/solaris-10u5 -i SUNWfoo -x SUNWcakr -x SUNWcar -x SUNWkvm
--- bldcat.orig 2009-11-23 13:45:58.436220417 +0000
+++ bldcat 2009-11-23 13:42:27.098746854 +0000
@@ -100,3 +100,3 @@
foreach (glob "$tmpdir/*") {
- ($pkgname) = (/([\w\+-]+)$/) if (-d);
+ ($pkgname) = (/([\w\+-\.]+)$/) if (-d);
}
2011-07-26 at 04:42 |
why every package start with the name of sunw in solaris?
2011-08-04 at 00:55 |
It’s a naming convention that packages in Solaris start with the 3 or 4-letter stock ticker. Sun’s ticker is SUNW. Other packages, e.g. OpenCSW packages start with CSW, for example CSWvim.