:.     Home     .:.     Cours     .:.     Faits divers     .:.     Blagues     .:.     Liens     .:.     Perso     .:

 

Solaris pkg-get tool

 

pkg-get is a tool to automate download and installation of binary packages from archive sites that support it.

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 of the package already installed, using 'upgrade' instead of 'install' will replace the older version with a newer one, if available.

If the archive supports dependancies, pkg-get will also download any needed dependancies. For example

# pkg-get install mod_php
should triger an automatic
# pkg-get install apache
which in turn should automatically trigger
# pkg-get install openssl

A site that supports these dependancies is www.blastwave.org. Currently, as of Feb 2003, sunfreeware.com does not support dependancies.

Checking available software

As well as providing easy installation of software, pkg-get provides you with a quick way to see what software is available for download.

Here's some sample output:

# 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
...
                         ...                          ...
If you dont want to see the local status of packages, but just see what is available for download, "pkg-get available" will print out just the software name and remote revision available.

----------------------------------------------------------------------------------------------------

 

With pkg-get v2.0, you can also see a list of software descriptions, for sites that provide a 'descriptions' file.

Sample output:

# pkg-get describe

# (Descriptions from site ibiblio.org )
aalib - Ascii art graphics library
achievo - Project Management tool, in PHP
apache - apache webserver with mod_ssl included
autoconf - GNU auto-configuration tool
automake - GNU makefile autogenerator tool
berkeleydb3 - file based pseudo-database library
berkeleydb4 - embedded database libraries and utilities
binutils - GNU 'binary utilities': gas, gld, gprof, and others
bison - GNU yacc parser generator
ccache - Compiler Cache caches gcc output files
cdrtools - tools for ripping from and recording to CDs and DVDs
common - common files and dirs for CSW packages

....

You can even search for things using regular expressions

# ( -D is synonymous with describe )
$ pkg-get -D '^g.. '
# (Descriptions from site ibiblio.org )
gdb - The GNU Debugger
gm4 - GNU m4 Unix macro processor
gtk - the Gimp ToolKit library, libgtk

Proxies

If you need to use a proxy to reach the outside, you will need to do two things:

1. Install 'wget' yourself
2. Adjust the pkg-get config file

To get wget installed, you can install it from the solaris 8 "companion CD", or download the package from the pkg-get archive site you choose to use, or download the source and compile it yourself.

To adjust the config file, you may first have to 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

Usually, a particular package archive has mirror sites. 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 whatever mirror site is closest to you.

To temporarily change the site you connect to, (if the main site is down or slow, for example) specify an alternate site 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

----------------------------------------------------------------------------------------------------


Downloading pkg-get

For the newer pkg-get version 2, that supports the latest features like a descriptions file, go to
blastwave.org's pkg-get download page

The older version of pkg-get can be obtained by 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, 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, after tweaking the url in pkg-get.conf Then you're all set to go!

If you would prefer a more menu-driven approach than pkg-get's pure commandline interface, please try pkgadm. The download page also has a screenshot of what it looks like in comparision. pkg-get has more features, however.

 

Local Site Mirrors

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.

Download-only mode

Speaking of local copies, you can tell pkg-get to just download packages and stop, rather than automatically installing them. If you are talking to an archive site that supports md5 hashes on the packages, (and you have an md5 program installed) you will get an automatic hash check of the download. Even better, if you have already downloaded the file to the current directory, it will compare the md5 hash, and tell you if you dont need to download it again.

"Community SoftWare" packages

There is an effort underway to create a large set of packages, with bug tracking, and package creation done by "the community".

There are currently over 170 packages available (April 2003), with more on the way.

Please visit The CSW package site, to see the latest in binary packages for Solaris.

www.blastwave.org also hosts downloads for pkg-get version 2. Since no other binary archive site has chosen to support the extra features for version 2, [like searchable descriptions, gpg signed packages, and others]

pkg-get v2 is only available from there

 

----------------------------------------------------------------------------------------------------

Author:Philip Brown [available for after-hours consulting]

Sources :

http://www.bolthole.com/solaris/pkg-get.html
http://www.bolthole.com/solaris/

 


L'information, n'est-elle pas précieuse ? Partageons la tous ensemble !

© Janvier 2005
Roger YERBANGA
www.yerbynet.com