Solaris pkg-get tool:

[from bolthole.com]

This tool simplifies fetching the latest version of a package from compatible sites to be as simple as

 
 # pkg-get install gcc
This will automatically download the appropriate version for your architecture and OS revision (if available), and install the package. If you have an older version already installed, using 'upgrade' instead of 'install' will replace the older version with a newer one, if available.


If you would prefer a more menu-driven approach, please try pkgadm. The download page also has a screenshot of what it looks like in comparision.

The pkg-get (and pkgadm) utility is configurable, so that if you sent up a local copy of the package archives, you can use THAT server instead of going out to the internet.

Get the architecture-neutral (works for sparc and x86) package by SHIFT-clicking on:

BOLTpget.pkg v1.9.9 (last update, Dec 6, 2002)


Occasionally, there have been problems downloading the .pkg file. If you cannot download the .pkg file, shift-click to download this UU-Encoded Version. run uudecode BOLTpget.pkg.uue, and you will then have the BOLTpget.pkg file
Once downloaded, install with
  # pkgadd -d BOLTpget.pkg
and run 'pkg-get -U' to initialize the local catalog of available packages. Then you're all set to go!


Checking available software

As well as providing easy installation, pkg-get provides you with a quick way to see what software is available for download. Unfortunately, you dont get descriptions -- just package names. On the brighter side, that means updating the catalog file is fairly fast.

Here's some sample output:

junior# pkg-get compare  
       software          localrev         remoterev
          aalib   [Not installed]               1.2
         apache   [Not installed]             1.3.9
       autoconf   [Not installed]              2.13
       automake   [Not installed]               1.4
           bash   [Not installed]              2.03
          bison   [Not installed]              1.28
          bzip2   [Not installed]            0.9.0c
            cvs   [Not installed]            1.10.7
          emacs   [Not installed]              20.4
       enscript   [Not installed]             1.6.1
         expect   [Not installed]              5.32
           flex   [Not installed]            2.5.4a
           gawk   [Not installed]             3.0.4
            gcc            2.95.2              SAME
            gdb   [Not installed]              4.18
            gdb   [Not installed]               5.0

The "available" command just prints out the left and right column. Whereas "compare" takes extra time to generate the middle column of what version is installed locally.


Proxies

If you need to use a proxy to reach the outside, you will need to
  1. Install 'wget' yourself
  2. Adjust the pkg-get config file
To get wget installed, you can either install it from the solaris 8 "companion CD", or download the package from www.sunfreeware.com, or download the source and compile it yourself.

To adjust the config file, first run 'pkg-get' by itself to generate a default configuration file.
Then edit /etc/pkg-get.conf in your favourite editor and follow the directions in it to tell wget to go thorugh the ftp proxy, if it is not already configured to do so.

Changing FTP/HTTP server

If you dont happen to live in the USA, you probably will want to change the default ftp site!

And even if you are in the US, sometimes the main site is slow, so you'll prlbably want to change your default site anyway.

After running pkg-get once to create the default config file, /etc/pkg-get.conf, edit that file, and change the url to point to one of the sites mentioned by http://www.sunfreeware.com/ftp.html

To temporarily change the site you connect to, (if the main site is down or slow, for example) specify an alternate siite with pkg-get -s ftp://tmp.site/path/url. Note that you'll have to first run

pkg-get -s ftp://tmp.site/path/url -U
to get the catalog for that site, before you can use the 'install' subcommand.

More info

For more gruesome details, "man pkg-get". Or... read the script!

To make your own software archive for pkg-get, you can use the makecontents script

HTTP access to files

If you dont have ftp access for some reason, you can now tell pkg-get to use http URLs instead. Here is a partial list of potential sunfreeware.com mirror sites you can access via http:

http://mirrors.xmission.com/sunfreeware (USA)
http://www.planetmirror.com/pub/sunfreeware (Australia)
http://sunsite.univie.ac.at/pub/solaris/smc (Austria)
http://www.imtech.res.in/pub/mirror_sites/sunfree (India)
http://mirror.nucba.ac.jp/mirror/solaris-freeware (Japan)
http://SunSITE.sut.ac.jp/pub/sun-info/Solaris (Japan)
http://ftp.sunet.se/pub/vendor/sun/freeware (Sweden)

Just pick the site "closest" to you, and adjust the url line in /etc/pkg-get.conf. But you must have pkg-get from Oct 29, 2001 or newer, to use http as a transport.
("pkginfo -l BOLTpget" should say VERSION: 1.8 or better.)


Author:Philip Brown   [available for after-hours consulting]
More Solaris stuff Bolthole Top