Application Packaging Developer's Guide

Installing Software Packages

Software packages are installed using the pkgadd command. This command transfers the contents of a software package from the distribution medium or directory and installs it onto a system.

This section provides basic installation instructions for installing your package in order to verify that it installs correctly. For more comprehensive installation examples, such as installing packages for diskless clients in a heterogeneous environment, see "Software Administration (Tasks)" in System Administration Guide, Volume I

The Installation Software Database

Information for all packages installed on a system is kept in the installation software database. There is an entry for every object in a package, with information such as the component name, where it resides, and its type. An entry contains a record of the package to which a component belongs; other packages that might reference the component; and information such as path name, where the component resides and the component type. Entries are added and removed automatically by the pkgadd and pkgrm commands. You can view the information in the database by using the pkgchk and the pkginfo commands.

Two types of information are associated with each package component. The attribute information describes the component itself. For example, the component's access permissions, owner ID, and group ID are attribute information. The content information describes the contents of the component, such as file size and time of last modification.

The installation software database keeps track of the package status. A package can be either fully installed (it has successfully completed the installation process), or partially installed (it did not successfully complete the installation process).

When a package is partially installed, portions of a package may have been installed before installation was terminated; thus, part of the package is installed, and recorded in the database, and part is not. When you reinstall the package, you are prompted to start at the point where installation stopped because the pkgadd command can access the database and detect which portions have already been installed. You can also remove the portions that have been installed, based on the information in the installation software database using the pkgrm command.

Interacting with the pkgadd Command

If the pkgadd command encounters a problem, it first checks the installation administration file for instructions. (See the admin(4) man page for more information.) If no instructions exist, or if the relevant parameter in the administration file is set to ask, the pkgadd displays a message describing the problem and prompts for a reply. The prompt is usually Do you want to continue with this installation?. You should respond with yes, no, or quit.

If you have specified more than one package, no stops installation of the package being installed but pkgadd continues with installation of the other packages. quit indicates that pkgadd should stop installation of all packages.

Installing Packages on Standalones or Servers in a Homogeneous Environment

How to Install a Package on a Standalone or Server

  1. Build your package.

    See "Building a Package", if needed.

  2. Log in to the system as superuser.

  3. Add the software package to the system.


    # pkgadd -d device-name [pkg-abbrev...]

    -d device-name

    Specifies the location of the package. Note that device-name can be a full directory path name or the identifiers for a tape, floppy disk, or removable disk.

    pkg-abbrev

    Is the name of one or more packages (separated by spaces) to be added. If omitted, pkgadd installs all available packages.

Where to Go Next

If you are ready to go to the next task, see "How to Verify the Integrity of Your Package".

Example--Installing Packages on Standalones and Servers

To install a software package named pkgA from a tape device named /dev/rmt/0, you would enter the following command:


# pkgadd -d /dev/rmt/0 pkgA

You can also install multiple packages at the same time, as long as you separate package names with a space, as follows:


# pkgadd -d /dev/rmt/0 pkgA pkgB pkgC

If you do not name the device on which the package resides, the command checks the default spool directory (/var/spool/pkg). If the package is not there, the installation fails.

Installing Packages for Diskless Clients and AutoClient Systems on a Server

This section describes how to install packages for a client system that places files in the root (/) file system. Note that packages that do not place files in root (/) can be made available to client systems by installing the package on the server with the pkgadd command--these packages are then made available when the file systems are mounted by the client systems.

Packages that are not part of the Solaris operating environment (unbundled software packages) should be installed into /opt. However, some packages, such as a package containing a device driver, must be installed into root (/) or /usr.

Use the pkgadd command on a server to install software for the use of client systems. Software installed for the use of client systems is installed in the client system's root (/) file system, not the server's root (/) file system. A diskless client's and AutoClient system's root (/) file system is located on the server, in the directory /export/root/client.

Files installed in the client system's root (/) file system appear in the client system's software database as installed. Files that the client expects to find in its /usr file system are shown as shared in the client system's database. The shared files must be installed on the server with a separate invocation of the pkgadd command.

How to Add a Package to a Diskless or AutoClient System's Root File System

  1. Build your package.

    See "Building a Package", if needed.

  2. Log in to the server as superuser.

  3. Add a software package to the client system's root file system.


    server# pkgadd -d device-name -R rootpath [pkg-abbrev...]

    -d device-name

    Specifies the location of the package. Note that device-name can be a full directory path name or the identifiers for a tape, floppy disk, or removable disk.

    -R rootpath

    Specifies the location of the client system's root (/) file system on the server.

    pkg-abbrev

    Is the name of one or more packages (separated by spaces) to be added. If omitted, pkgadd installs all available packages.

Where to Go Next

If you are ready to go to the next task, see "How to Verify the Integrity of Your Package".

Example--Installing a Package to a Diskless Client's Root File System

The following example shows a command to install the SUNWadmr (software to support system and network administration) package from a server onto a diskless client's root file system. In this case, the diskless client's root file system is /export/root/client-1. This example assumes the SUNWadmr package is available from a mounted SPARC 2.x Solaris CD (/cdrom/cdrom0/s0/Solaris_2.7).


server# pkgadd -d /cdrom/cdrom0/s0/Solaris_2.7 -R 
/export/root/client-1 SUNWadmr
			.
			.
			.
Installation of <SUNWadmr> complete.
server#