System Administration Guide: Basic Administration

Chapter 23 Managing Software (Tasks)

This chapter describes how to add, verify, and remove software packages.

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

Commands for Managing Software Packages

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

Table 23–1 Tools or Commands for Managing Software Packages

Tool or Command  

Man Page 

Description 

admintool

admintool(1M)

Installs or removes a software package with a graphical tool 

installer

installer(1M)

Installs or removes a software package with an installer 

pkgadd

 

pkgadd(1M)

Installs a software package 

pkgchk

pkgchk(1M)

Checks the installation of a software package 

pkginfo

pkginfo(1)

Lists software package information 

pkgparam

 

pkgparam(1)

Displays software package parameter values 

pkgrm

pkgrm(1M)

Removes a software package 

prodreg

prodreg(1M)

Installs or removes a software package with an installer 

Adding Software With the Solaris Web Start Program

This section describes how to use the Solaris Web Start program to add software to a system on which you have installed the Solaris operating environment. The Solaris Web Start program installs only the components of the software groups that you skipped when you initially installed the Solaris operating environment. You cannot upgrade to another software group after installing or upgrading. For a description of the four software groups, see Solaris 9 Installation Guide.

How to Install Software With the Solaris Web Start Program


Note –

This procedure assumes that the system is running volume management (vold). If your system is not running volume management, see Chapter 18, Accessing Removable Media (Tasks) for information on accessing removable media without volume management.


  1. Become superuser or assume an equivalent role.

  2. Decide to install from a CD, a DVD, or from the network. Select one of the following:

    • If you are installing from a CD, insert the CD into the CD-ROM drive.

      If you insert the Solaris 9 Languages CD, the Solaris Web Start program starts automatically. Proceed to Step 6.

    • If you are installing from a DVD, insert the DVD into the DVD-ROM drive.

    • If you are installing from the network, locate the net image of the software you want to install.

  3. Change directories to find the Solaris Web Start installer.

    Solaris Web Start installers are located in various directories on the CDs and on the DVD.

    • Solaris 9 Software 1 of 2 CD.

    • Solaris 9 Software 2 of 2 CD.

    • Solaris 9 Documentation CD.

    • Solaris 9 Languages CD. The Solaris Web Start program automatically starts when the CD is inserted.

    For specific information about CD and DVD structures, see “Organization of Solaris 9 Media” in Solaris 9 Installation Guide.

  4. Follow the instructions to install the software.

    • From a file manager, double-click Installer or installer.

    • From the command line, type the following:


       % ./installer [options]

      -nodisplay

      Runs the installer without a GUI. 

      -noconsole

      Runs without any interactive text console device. Use this option with the -nodisplay option when you include the installer command in a UNIX script for installing software.

      Follow the instructions to install the software.

  5. Double-click Installer or installer.

    An Installer window is displayed, followed by the Solaris Web Start dialog box.

  6. Follow the directions on the screen to install the software.

  7. When you have finished adding software, click Exit.

    The Solaris Web Start program exits.

Adding and Removing Software With the Product Registry

The Solaris Product Registry is a GUI tool to help you manage installed software. After you have installed the software, Product Registry provides a list of all the installed software by using the Solaris Web Start program 3.0 or the Solaris pkgadd command.

The Solaris Product Registry enables you to do the following:

The Solaris Product Registry main window consists of three areas of information:

Figure 23–1 Solaris Product Registry Window

Graphic

How to View Installed or Uninstalled Software Information With the Product Registry

  1. Become superuser or assume an equivalent role.

  2. Start the Product Registry tool.


    # prodreg &
    

    The Solaris Product Registry main window is displayed.

  3. Click the turner control to the left of the System registry directory in the Registered Software box.

    Notice that the turner control changes from pointing to the right to pointing down. You can expand or collapse any item in the Registry, except an item that has a text file icon to its left.

    The Software Installed in Registered Software box always contains the following:

    • The configuration software group you chose when installing the Solaris release. Software groups that can be displayed include Core, End User System Support, Developer System Support, Entire Distribution, or Entire Distribution Plus OEM Support.

    • Additional system software (Solaris products that are not part of the software group you chose).

    • Unclassified software (any package that you installed by using the pkgadd command that is not a Solaris product or part of the software group).

  4. Select directories until you find a software application to view.

    The list expands as you open directories.

  5. To view the attributes, select a directory or file.

    The Product Registry displays attribute information in the System Registry box.

    • For software products that were installed with the Solaris Web Start program, the Product Registry contains values for at least the following: Title, Version, Location, and Installed on. Items in an expanded list under a product or software group inherit the version information of the product.

    • If all or part of the product was removed with the pkgrm command, a cautionary icon appears next to the software product's name.

How to Install Software With the Product Registry

You can use Product Registry to find software and launch the Solaris Web Start program, which leads you through the installation of that software.

  1. Become superuser or assume an equivalent role.

  2. Start the Product Registry tool.


    # prodreg
    

    The Solaris Product Registry window is displayed.

  3. Decide if you are installing from a CD, a DVD, or from the network. Select one of the following:

    • If you are installing from a CD, insert the CD into the CD-ROM drive.

    • If you are installing from a DVD, insert the DVD into the DVD-ROM drive.

    • If you are installing from the network, locate the net image of the software that you want to install.

  4. To view the list of installed and registered software, click the turner control.

  5. Click the New Install button at the bottom of the Solaris Product Registry window.

    The Product Registry displays the Select Installer dialog box, which initially points to the /cdrom directory or the directory you are in.

  6. Select directories to find the Solaris Web Start program installer.

    Solaris Web Start installers are located in various directories on the CDs and on the DVD. For specific information about CD and DVD structures, see “Organization of Solaris 9 Media” in Solaris 9 Installation Guide.

    • Solaris 9 Software 1 of 2 and 2 of 2 CD.

    • Solaris 9 Software 2 of 2 CD.

    • Solaris 9 Documentation CD.

    • Solaris 9 Languages CD. The Solaris Web Start program automatically starts when the CD is inserted.

  7. When you find the installer you want, select its name in the Files box.

  8. Click OK.

    The installer you selected is launched.

  9. Follow the directions that are displayed by the installer to install the software.

How to Uninstall Software With the Product Registry

  1. Become superuser or assume an equivalent role.

  2. Start the Product Registry tool.


    # prodreg
    

    The Solaris Product Registry window is displayed.

  3. To view the list of installed and registered software, click the turner control.

  4. Select directories until you find the name of the software that you want to uninstall.

  5. Read the software attributes to make sure that this software is the software you want to uninstall.

  6. Click the Uninstall software-product-name button at the bottom of the Solaris Product Registry window.

    The software product you selected is uninstalled.

Adding and Removing Software Packages With 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 do the following:

How to Add Software Packages With Admintool

  1. Become superuser.

    Unless you are a member of the sysadmin group (group 14), you must become superuser or assume an equivalent role to add or remove software packages with Admintool.

  2. Load a Solaris 9 Software CD or DVD into the drive.

    Volume Manager automatically mounts 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 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 that corresponds 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 is refreshed to display the packages just added.

How to Remove Software Packages With Admintool

  1. Become superuser.

    Unless you are a member of the sysadmin group (group 14), you must become superuser or assume an equivalent role to add or remove software packages with Admintool.

  2. Start Admintool.


    # admintool &
    

    The Users window is displayed.

  3. Choose Software from the Browse menu.

    The Software window is displayed.

    Graphic
  4. Select the software you want to delete 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 delete 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.

Adding and Removing Software Packages With Package Commands

This section describes how to add, check, and remove packages with the package commands.

How to Add Software Packages (pkgadd)

  1. Become superuser or assume an equivalent role.

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

    This step 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 maintaining multiple software copies, see Guidelines for Removing Packages, and for task information, see How to Remove Software Packages (pkgrm).

  3. Add a software package to the system.


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

    -a admin-file

    (Optional) Specifies an administration file that the pkgadd command 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 the pkgadd command 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. The pkgadd command continues to install the other packages. Type quit to stop the installation.

  4. Verify that the package has been installed successfully.


    # pkgchk -v pkgid
    

    If there are no errors, a list of installed files is returned. Otherwise, the pkgchk command reports the error.

Example—Adding Software Packages From a Mounted CD

The following example shows how install the SUNWpl5u package from a mounted Solaris 9 CD. The example also shows how to verify that the package files were installed properly.


# pkgadd -d /cdrom/cdrom0/s0/Solaris_9/Product SUNWpl5u
	.
	.
	.
Installation of <SUNWpl5u> was successful.
# pkgchk -v SUNWpl5u
/usr
/usr/bin
/usr/bin/perl
/usr/perl5
/usr/perl5/5.00503
.
.
.

Example—Installing Software Packages From a Remote Package Server

If the packages you want to install are available from a remote system, you can manually mount the directory that contains the packages (in package format) and install packages on the local system.

The following example shows how install software packages from a remote system. In this example, assume that 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 SUNWpl5u package.


# mount -F nfs -o ro package-server:/latest-packages /mnt
# pkgadd -d /mnt SUNWpl5u
	.
	.
	.
Installation of <SUNWpl5u> 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 SUNWpl5u
	.
	.
	.
Installation of <SUNWpl5u> was successful.

The following example is similar to the previous example, 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 that the noask-pkgadd administration file is in the default location, /var/sadm/install/admin.


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

Adding a Software Package to 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 you use the pkgadd command. The pkgadd command, by default, checks 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 Software Packages to a Spool Directory (pkgadd)

  1. Become superuser or assume an equivalent role.

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

    For information on removing spooled packages, see Example—Removing a Spooled Software 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, the pkgadd command copies all available packages.

  4. Verify that the package has been copied successfully to the spool directory.


    $ pkginfo -d spooldir| grep pkgid
    

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

Example—Setting Up a Spool Directory From a Mounted CD

The following example shows how to transfer the SUNWman package from a mounted SPARC Solaris 9 CD to the default spool directory (/var/spool/pkg).


# pkgadd -d /cdrom/cdrom0/s0/Solaris_9/Product -s /var/spool/pkg SUNWman
Transferring <SUNWman> package instance

Example—Setting Up a Spool Directory From a Remote Software Package Server

If packages you want to copy are available from a remote system, you can manually mount the directory that contains the packages (in package format) and copy them to a local spool directory.

The following example shows the commands to do this scenario. In this example, assume that 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 SUNWpl5p 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 SUNWpl5p
Transferring <SUNWpl5p> 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 SUNWpl5p
Transferring <SUNWpl5p> package instance

Example—Installing Software Packages From the Default Spool Directory

The following example shows how to install the SUNWpl5p package from the default spool directory. When no options are used, the pkgadd command searches the /var/spool/pkg directory for the named packages.


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

How to List Information About All Installed Packages (pkginfo)

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 the 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
.
.
.

Example—Displaying Detailed Information About Software Packages


$ pkginfo -l SUNWcar
   PKGINST:  SUNWcar
      NAME:  Core Architecture, (Root)
  CATEGORY:  system
      ARCH:  sparc.sun4u
   VERSION:  11.9.0,REV=2001.10.16.17.05
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  core software for a specific hardware platform group
    PSTAMP:  crash20011016171723
  INSTDATE:  Nov 02 2001 08:53
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:    111 installed pathnames
                36 shared pathnames
                40 directories
                56 executables
             17626 blocks used (approx)

How to Check the Integrity of Installed Software Packages (pkgchk)

  1. Become superuser or assume an equivalent role.

  2. Check the status of an installed package.


    # pkgchk -a| -c -v pkgid ...
    # pkgchk -d spooldir pkgid ...

    -a

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

    -c

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

    -v

    Specifies verbose mode, which displays file names as they are processed. 

    -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, all the software packages installed on the system are checked.

Example—Checking the Contents of Installed Software Packages

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


# pkgchk -c SUNWbash

If there are no errors, the system prompt is returned. Otherwise, the pkgck command reports the error.

Example—Checking the File Attributes of Installed Software Packages

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


# pkgchk -a SUNWbash

If there are no errors, the system prompt is returned. Otherwise, the pkgck command reports the error.

Example—Checking Software Packages Installed in a Spool Directory

The following example shows how to check a software package that was 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.


Removing Software Packages


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 Software Packages (pkgrm)

  1. Become superuser or assume an equivalent role.

  2. Remove an installed package.


    # pkgrm pkgid ...

    pkgid identifies the name of one or more packages (separated by spaces) to be removed. If omitted, pkgrm removes all available packages.

Example—Removing Software Packages

This example shows how to remove a package.


# pkgrm SUNWctu

The following package is currently installed:
   SUNWctu         Netra ct usr/platform links (64-bit)
                   (sparc.sun4u) 11.9.0,REV=2001.07.24.15.53

Do you want to remove this package? y

## Removing installed package instance <SUNWctu>
## Verifying package dependencies.
## Processing package information.
## Removing pathnames in class <none>
.
.
.

Example—Removing a Spooled Software Package

This example shows how to remove a spooled package.


# pkgrm -s /export/pkg SUNWdmfex.u
The following package is currently spooled:
   SUNWdmfex.u           Sun Davicom 10/100Mb Ethernet Driver (64-bit)
                         (sparc.sun4u) 11.9.0,REV=2001.07.24.15.53

Do you want to remove this package? y

Removing spooled package instance <SUNWdmfex.u>