System Administration Guide, Volume I

How to Add Packages to a Standalone System

  1. Log in as superuser.

  2. Remove any already installed packages with the same names 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".

  3. Add a software package to the system.


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

    -a admin-file

    (Optional) Specifies an administration file pkgadd should consult during the installation. (For details about using an administration file, see "Using an Administration File" in the previous chapter.)

    -d device-name

    Specifies the absolute path to the software packages. device-name can be a the 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 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.

Example--Installing Software From a Mounted CD


Note -

The name of this release is Solaris 7 but code and path or package path names may use Solaris 2.7 or SunOS 5.7. Always follow the code or path as it is written.


The following example shows a command to install the SUNWaudio package from a mounted Solaris 7 CD. The example also shows use of the pkgchk command to verify that the packages 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

Example--Installing Software From a Remote Package Server

If the packages you want to install are available from a remote system, you can manually mount the directory containing the packages (in package format) 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, which is illustrated in "Avoiding User Interaction When Adding Packages". 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.