Mandalika's scratchpad [ Work blog @Oracle | My Music Compositions ]

Old Posts: 09.04  10.04  11.04  12.04  01.05  02.05  03.05  04.05  05.05  06.05  07.05  08.05  09.05  10.05  11.05  12.05  01.06  02.06  03.06  04.06  05.06  06.06  07.06  08.06  09.06  10.06  11.06  12.06  01.07  02.07  03.07  04.07  05.07  06.07  08.07  09.07  10.07  11.07  12.07  01.08  02.08  03.08  04.08  05.08  06.08  07.08  08.08  09.08  10.08  11.08  12.08  01.09  02.09  03.09  04.09  05.09  06.09  07.09  08.09  09.09  10.09  11.09  12.09  01.10  02.10  03.10  04.10  05.10  06.10  07.10  08.10  09.10  10.10  11.10  12.10  01.11  02.11  03.11  04.11  05.11  07.11  08.11  09.11  10.11  11.11  12.11  01.12  02.12  03.12  04.12  05.12  06.12  07.12  08.12  09.12  10.12  11.12  12.12  01.13  02.13  03.13  04.13  05.13  06.13  07.13  08.13  09.13  10.13  11.13  12.13  01.14  02.14  03.14  04.14  05.14  06.14  07.14  09.14  10.14  11.14  12.14  01.15  02.15  03.15  04.15  06.15  09.15  12.15  01.16  03.16  04.16  05.16  06.16  07.16  08.16  09.16  12.16  01.17  02.17  03.17  04.17  06.17  07.17  08.17  09.17  10.17  12.17  01.18  02.18  03.18  04.18  05.18  06.18  07.18  08.18  09.18  11.18  12.18  01.19  02.19  05.19  06.19  08.19  10.19  11.19  05.20  10.20  11.20  12.20  09.21  11.21  12.22 


Sunday, June 05, 2005
 
Solaris: Installing apps/packages with pkg-get

Often it is very frustrating to install software on *nix systems, and Solaris is no exception. Most of the times, non-availability of software in "ready to install" form, and/or the lack of installed dependencies on the local system, makes it even hard for the novice end-user. Wouldn't it be nice to have some kind of tool, that does the installation for us automatically, including dependencies (if any)? Fortunately, tools like apt-get, pkg-get do exist on some *nix environments, for automatic package installations.

apt-get (Advanced Package Tool) is available on some Linux distributions, quite for some time. For more on apt-get, have a look at the web page, APT HOWTO.

The following paragraphs concentrate on a similar tool, pkg-get for Solaris environment.

What is pkg-get?
(The following text was borrowed from bolthole.com; full-text can be viewed at: 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.
One of the sites that supports these dependancies is www.blastwave.org. Another one is www.sunfreeware.com. Rest of the instructions focus on installing pkg-get to get packages from blastwave.org. To get packages from sunfreeware.com, /etc/pkg-get.conf has to be modified as explained in the latter parts of "How to install pkg-get?" section.

How to install pkg-get?
(source: blastwave.org; full-text is at: http://www.blastwave.org/howto.html)
  1. Download pkg-get from http://www.blastwave.org/pkg_get.pkg. Since it is a package, it has to be installed with pkgadd command on Solaris.

    % pkgadd -d <path of pkg-get>/pkg-get.pkg
  2. Download and install a copy of wget
    Download locations:
    SPARC version: wget-sparc.bin
    x86 version : wget-i386.bin

    (From GNU wget FAQ) wget is a network utility to retrieve files from the World Wide Web using HTTP and FTP, the two most widely used Internet protocols. It works non-interactively, so it can work in the background, after having logged off. The program supports recursive retrieval of web-authoring pages as well as FTP sites - you can use wget to make mirrors of archives and home pages or to travel the Web like a WWW robot.

    This version of wget is simple, without any dependencies. But this copy is good enough to install the complete wget package as explained later.

    Make the wget, an executable and add it to the PATH environment variable. This step is very important for pkg-get to work properly. So, make sure you have wget in your PATH, before you move on to the next step.
  3. Make sure that you have both wget, and pkg-get in your PATH, with which wget, and which pkg-get commands.
  4. Edit pkg-get configuration file: /etc/pkg-get.conf file, to get software packages from a nearby source. You can find a list of Blastwave mirrors at: http://www.blastwave.org/mirrors.php.
  5. Install the complete wget package with the man pages and dependencies.

    % pkg-get -i wget. -i switch can be used to instruct pkg-get to install something.

    Now remove the simple wget that was installed in step (2).

    Add /opt/csw/bin at the beginning of PATH variable (the essential pkg-get & wget tools will reside under code>/opt/csw/bin directory.). Also add /opt/csw/man to the MANPATH to read the newly installed manual pages.

    man pkg-get is a good starting point to use pkg-get, conveniently.
Quick Reference
  1. pkg-get available, lists all the software that is available for download on the remote server. pkg-get compare is similar to pkg-get available, except that it shows the local status of the packages as well.
  2. A list of software descriptions can be viewed with pkg-get describe.
  3. You can search for software using regular expressions.
    eg.,
    -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

  4. To install a package:
    pkg-get install <pkg> Or pkg-get -i <pkg>
    eg.,
    % pkg-get -i firefox
  5. To upgrade a package:
    pkg-get upgrade <pkg> Or pkg-get -U <pkg>
    eg.,
    % pkg-get -U firefox
Note:
pkg-get is a pure command line interface. If you are more used to Windows environment, you can try pkgadm tool from bolthole.com. More information is available at: Solaris pkgadm tool.

Acknowledgements & recommendations:
  1. bolthole.com
  2. blastwave.org
  3. sunfreeware.com
Technorati Tag:


Comments:
I have decided that this stuff is the most important tool that I have to masterize in order to reach a successful life. The fact of matter is that I have always loved every single thing which is somehow related to computers and stuff.
By the way, I have found pretty interesting stuff in this column. In short, I realized this is certainly a great piece of work.
 
Post a Comment



<< Home


2004-2019 

This page is powered by Blogger. Isn't yours?