Solaris Internationalization Guide For Developers

Adding Packages

This section describes how to install packages with the pkgadd command.

How to Add Packages to a Standalone System

  1. Log in as root.

  2. Remove any packages with the same name as the ones you are adding.

    This ensures that the system keeps a proper record of software that has been added and removed. There may be times when you want to maintain multiple versions of the same application on the system. For strategies on how to do this, see "Guidelines for Removing Packages," and for task information, see "How to Remove a Package." Both of these can be found in the System Administration Guide

  3. Add one or more software packages to the system.


    # pkgadd -a admin-file -d device-name pkgid...
    

    In this command,

    -a admin-file

    (Optional) Specifies an administration file that pkgadd should consult during the installation. (For details about using an administration file, see the System Administration Guide.

    -d device-name

    Specifies the absolute path to the software packages. Device-name can be a path to a device, a directory, or a spool directory. If you do not specify the path where the package resides, the pkgadd command checks the default spool directory (/var/spool/pkg). If the package is not there, the package installation fails.

    pkgid

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

    If pkgadd encounters a problem during installation of the package, it displays a message related to the problem, followed by this prompt:


    Do you want to continue with this installation?

    Respond with yes, no, or quit. If more than one package has been specified, type no to stop the installation of the package being installed. pkgadd continues to install the other packages. Type quit to stop the installation.

  4. Verify that the package has been installed successfully, using the pkgchk command.


    # pkgchk -v pkgid
    

    If pkgchk determines there are no errors, it returns a list of installed files. Otherwise, it reports the error.

Installing Software From a Mounted CD

The following example shows a command to install the SUNWaudio package from a CD mounted on the Solaris 2.6 operating environment or compatible versions. The example also shows use of the pkgchk command to verify that the package files were installed properly.


# pkgadd -d /cdrom/cdrom0/s0/Solaris_2.7/Product SUNWaudio
.
.
.
Installation of SUNWaudio> complete.
# pkgchk -v SUNWaudio
/usr
/usr/bin
/usr/bin/audioconvert
/usr/bin/audioplay
/usr/bin/audiorecord

Installing Software From a Remote Package Server

If the packages you want to install are available from a remote system, you can mount the directory containing the packages (in package format) manually and install packages on the local system. The following example shows the commands to do this. In this example, assume the remote system named package-server has software packages in the /latest-packages directory. The mount command mounts the packages locally on /mnt, and the pkgadd command installs the SUNWaudio package.


# mount -F nfs -o ro package-server:/latest-packages /mnt
# pkgadd -d /mnt SUNWaudio
.
.
.
Installation of SUNWaudio> was successful.

If the automounter is running at your site, you do not need to mount the remote package server manually. Instead, use the automounter path (in this case, /net/package-server/latest-packages) as the argument to the -d option.


# pkgadd -d /net/package-server/latest-packages SUNWaudio
.
.
.
Installation of SUNWaudio> was successful.

The following example is similar to the previous one, except it uses the -a option and specifies an administration file named noask-pkgadd. In this example, assume the noask-pkgadd administration file is in the default location, /var/sadm/install/admin.


# pkgadd -a noask-pkgadd -d /net/package-server/latest-packages SUNWaudio
.
.
.
Installation of SUNWaudio> was successful.