Pkgutil is the new way of installing Solaris packages. It downloads and installs packages, including their dependencies, not to mention it has many other useful features. Below is a quick way to install pkgutil, after that you just do, e.g. “pkgutil -i apache2″ to install apache2 including all needed dependencies. More info (usage examples and so on) is available at the pkgutil wiki.

Solaris 10 and OpenSolaris

# pkgadd -d http://get.opencsw.org/now

Solaris 8 and 9

Similar to Solaris 10, except you need to download the pkgutil package by hand. Remember to use “save as…” or shift-click, if you need to. Use wget if you can.

# wget http://mirror.opencsw.org/opencsw/pkgutil.pkg
# pkgadd -d pkgutil.pkg

If you run into pkgadd problems, you will need to add Sun’s pkgadd patches. Solaris 8: 110934 (SPARC) 110935 (x86). Solaris 9 113713 (SPARC) 114568 (x86).

Configuration

You can then edit /etc/opt/csw/pkgutil.conf to choose a mirror site that is better for you than the default. The mirror page also has information on how to use gpg checks for the catalog to increase security.

Add /opt/csw/bin to root’s PATH. On Solaris 10 it’s defined in /etc/default/login. You also need gzip somewhere in your PATH. Most people do these days, unless you did a minimalist “Core install” of Solaris. To further tweak pkgutil to your liking, you can take a look at the man/perldoc page for pkgutil, all options are documented there.

Upgrade

Please note that the pkgutil packages available via mirror.opencsw.org are not always up to date so you should upgrade pkgutil immediately to make sure you have the latest available version.

# pkgutil -v
1.7
# pkgutil -u pkgutil
# pkgutil -v
2.1