System Administration Guide, Volume 1

Chapter 21 Software Administration (Tasks)

This chapter describes how to install, remove, and administer software packages with Solaris commands and the Admintool graphical interface.

This is a list of step-by-step instructions in this chapter.

Commands for Handling Software Packages

The table below shows commands to use for adding, removing, and checking the installation of software packages after the Solaris release is installed.

Table 21-1 Commands for Adding and Removing Packages

Command 

Description 

prodreg.1

Installs a software package with an installer 

pkgadd(1M)

Installs a software package 

pkgrm(1M)

Removes a software package 

pkgchk(1M)

Checks the installation of a software package 

pkginfo(1)

Lists software package information 

pkgparam(1)

Displays software package parameter values 

Known Problem With Adding and Removing Packages

There is a known problem with adding or removing some packages developed before the Solaris 2.5 release. If adding or removing a package fails during user interaction, or if you are prompted for user interaction and your responses are ignored, set the following environment variable:

NONABI_SCRIPTS=TRUE

Adding Packages

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 might 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 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

The following example shows a command to install the SUNWaudio package from a mounted Solaris 8 CD. The example also shows use of the pkgchk command to verify that the package files were installed properly.


# pkgadd -d /cdrom/sol_8_sparc/s0/Solaris_8/Product SUNWaudio
	.
	.
	.
Installation of <SUNWaudio> was successful.
# 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.

Using a Spool Directory

For convenience, you can copy frequently installed packages to a spool directory. If you copy packages to the default spool directory, /var/spool/pkg, you do not need to specify the source location of the package (-d device-name argument) when using the pkgadd command. The pkgadd command, by default, looks in the /var/spool/pkg directory for any packages specified on the command line. Note that copying packages to a spool directory is not the same as installing the packages on a system.

How to Add a Package to a Spool Directory

  1. Log in as superuser to the server or standalone system.

  2. Remove any already spooled packages with the same names as the ones you are adding.

    For information on removing spooled packages, see "How to Remove a Spooled Package".

  3. Add a software package to a spool directory.


    # pkgadd -d device-name -s spooldir pkgid ...

    -d device-name

    Specifies the absolute path to the software packages. device-name can be the path to a device, a directory, or a spool directory.

    -s spooldir

    Specifies the name of the spool directory where the package will be spooled. You must specify a spooldir.

    pkgid

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

  4. Verify that the package has been copied successfully to the spool directory, using the pkginfo command.


    $ pkginfo -d spooldir| grep pkgid
    

    If pkgid is copied correctly, the pkginfo command returns a line of information about it. Otherwise, pkginfo returns the system prompt.

Example--Setting Up a Spool Directory From a Mounted CD

The following example shows a command to copy the SUNWaudio and SUNWab2m packages from a mounted SPARC Solaris 8 CD to the default spool directory (/var/spool/pkg).


# pkgadd -d /cdrom/sol_8_sparc/s0/Solaris_8/Product -s /var/spool/pkg SUNWaudio
Transferring <SUNWaudio> package instance

Example--Setting Up a Spool Directory From a Remote Package Server

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


# mount -F nfs -o ro package-server:/latest-packages /mnt
# pkgadd -d /mnt -s /var/spool/pkg SUNWman
Transferring <SUNWman> package instance

If the automounter is running at your site, you do not have 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 -s /var/spool/pkg SUNWman
Transferring <SUNWman> package instance

Example--Installing a Package From the Default Spool Directory

The following example shows a command to install the SUNWman package from the default spool directory. (When no options are used with pkgadd, it searches /var/spool/pkg for the named packages.)


# pkgadd SUNWman
	.
	.
	.
Installation of <SUNWman> was successful.

Checking the Installation of Packages

You use the pkgchk command to check installation completeness, path name, file contents, and file attributes of a package. See pkgchk(1M) for more information on all the options.

Use the pkginfo command to display information about the packages that are installed on the system.

How to List Information About All Installed Packages

List information about installed packages with the pkginfo command.


$ pkginfo

Example--Listing All Packages Installed

The following example shows the pkginfo command to list all packages installed on a local system, whether that system is a standalone or server. The output shows the primary category, package name, and a description of the package.


$ pkginfo
system      SUNWaccr       System Accounting, (Root)
system      SUNWaccu       System Accounting, (Usr)
system      SUNWadmap      System administration applications
system      SUNWadmc       System administration core libraries
.
.
.

How to Check the Integrity of an Installed Package

  1. Log in to a system as superuser.

  2. Check the status of an installed package with the pkgchk command.


    # pkgchk [ -a -c -v ] pkgid ...
    # pkgchk -dspooldir pkgid ...

    -a

    Specifies to audit only the file attributes (that is, the permissions), rather than the file attributes and contents, which is the default for pkgchk.

    -c

    Specifies to audit only the file contents, rather than the file contents and attributes, which is the default for pkgchk.

    -v

    Specifies verbose mode, which displays file names as pkgchk processes them.

    -d spooldir

    Specifies the absolute path of the spool directory. 

    pkgid

    (Optional) Is the name of one or more packages (separated by spaces). If you do not specify a pkgid, pkgchk checks all the software packages installed on the system. If omitted, pkgchk displays all available packages.

Example--Checking the Contents of an Installed Package

The following example shows how to check the contents of a package.


# pkgchk -c SUNWadmfw

If pkgchk determines there are no errors, it returns the system prompt. Otherwise, it reports the error.

Example--Checking the File Attributes of an Installed Package

The following example shows how to check the file attributes of a package.


# pkgchk -a SUNWadmfw

If pkgchk determines there are no errors, it returns the system prompt. Otherwise, it reports the error.

Example--Checking Packages Installed in a Spool Directory

The following example shows how to check a software package copied to a spool directory (/export/install/packages).


# pkgchk -d /export/install/packages
## checking spooled package <SUNWadmap>
## checking spooled package <SUNWadmfw>
## checking spooled package <SUNWadmc>
## checking spooled package <SUNWsadml>

Note -

The checks made on a spooled package are limited because not all information can be audited until a package is installed.


How to Display Detailed Information About a Package

List information about installed packages with the pkginfo -l command.


$ pkginfo -l pkgid ...

-l

Specifies to display output in long format, which includes all available information about the package. 

pkgid

(Optional) Is the name of one or more packages (separated by spaces). If omitted, pkginfo displays information about all available packages.

Example--Displaying Detailed Information About a Package


$ pkginfo -l SUNWcar
   PKGINST:  SUNWcar
      NAME:  Core Architecture, (Root)
  CATEGORY:  system
      ARCH:  sparc.sun4u
   VERSION:  11.8.0,REV=1999.09.18.11.52
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  core software for a specific hardware platform group
    PSTAMP:  humbolt19990821191439
  INSTDATE:  Sep 18 1999 11:53
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:     95 installed pathnames
                31 shared pathnames
                35 directories
                49 executables
             11307 blocks used (approx) 

Removing Packages From Servers and Standalone Systems


Caution - Caution -

Always use the pkgrm command to remove installed packages. Do not use the rm command, which will corrupt the system's record-keeping of installed packages.


How to Remove a Package

  1. Log in to the system as superuser.

  2. Remove an installed package.


    # pkgrm pkgid ...

    pkgid

    (Optional) Is the name of one or more packages (separated by spaces). If omitted, pkgrm removes all available packages.

How to Remove a Spooled Package

  1. Log in as superuser.

  2. Remove a package from a spool directory with the pkgrm -s command.


    # pkgrm -s spooldir pkgid ... 

    -s spooldir

    Specifies the name of the spool directory where the package was spooled. 

    pkgid

    (Optional) Is the name of one or more packages (separated by spaces). If no pkgid is supplied, pkgrm prompts the user to remove each package listed in the spool directory. If omitted, pkgrm removes all available packages.

Adding and Removing Packages Using Admintool

The Solaris operating environment includes Admintool, which is a graphical user interface for performing several administration tasks, including adding and removing software packages. Specifically, you can use Admintool to:

How to Add Packages With Admintool

  1. Log in to the installed system and become superuser.

    At the shell prompt, type:


    $ su
    

    Unless you are a member of the UNIX sysadmin group (group 14), you must become superuser on your system to add or remove software packages with Admintool.

  2. Load a CD into the CD-ROM drive.

    Volume Manager will automatically mount the CD.

  3. Start Admintool.


    # admintool &
    

    The Users window is displayed.

  4. Choose Software from the Browse menu.

    The Software window is displayed.

  5. Choose Add from the Edit menu.

    The Set Source Media window might appear. If so, specify the path to the installation media and click OK. The default path is a mounted SPARC Solaris CD.

    The Add Software window is displayed.

    Graphic
  6. Select the software you want to install on the local system.

    In the Software portion of the window, click the check boxes corresponding to the software you want to install.

  7. Click Add.

    A Command Tool window appears for each package being installed, displaying the installation output.

    The Software window refreshes to display the packages just added.

How to Remove Packages With Admintool

  1. Log in to the installed system and become superuser.

    At the shell prompt, type:


    $ su
    

    Unless you are a member of the UNIX sysadmin group (group 14), you must become superuser on your system to add or remove software packages with Admintool.

  2. Start Admintool.


    # admintool &
    
  3. Choose Software from the Browse menu.

    The Software window is displayed.

    Graphic
  4. Select the software you want to remove from the local system.

  5. Choose Delete from the Edit menu.

    A warning pop-up window is displayed to confirm whether you really want to delete the software.

  6. Click Delete to confirm that you want to remove the software.

    For each package that is being deleted, a Command Tool window is displayed that asks for confirmation, again, before deleting the software. Type y, n, or q. If you choose to delete the software, the output from the removal process is displayed.