Information Library for Solaris 2.6 (Intel Platform Edition)

Adding and Removing Packages Using Commands

This section describes how to add and remove packages using commands at the command line.

How to Add Packages With the pkgadd Command

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

    At the shell prompt, type:

    $ su
    

  2. Load the CD that contains the packages to be added into the CD-ROM drive.

    Volume Manager will automatically mount the CD.

  3. Add one or more packages to the system using the pkgadd command.

    # /usr/sbin/pkgadd -d device_name pkgid
    

    In this command,

    device_name

    Is the path to the CD with the software to be added to the installed system. 

    pkgid

    Is the name of the software package to be added to the installed system. For example, SUNWaudio.

    If the pkgadd process 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 process continues to install the other packages. Type quit to stop the installation.

  4. Verify that the package has been installed correctly.

    # /usr/sbin/pkgchk -v pkgid
    

    If the pkgchk command 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 2.6 CD. The example also shows the use of the pkgchk command to verify that the package files were installed properly.

# /usr/sbin/pkgadd -d /cdrom/cdrom0/s0/Solaris_2.6 SUNWaudio.
.
.
Installation of <SUNWaudio> was successful.
# pkgchk -v SUNWaudio
/usr
/usr/bin
/usr/bin/audioconvert
/usr/bin/audioplay
/usr/bin/audiorecord
#

How to Remove Packages With the pkgrm Command

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

    At the shell prompt, type:

    $ su
    

  2. Remove one or more packages from the system using the pkgrm command.

    # /usr/sbin/pkgrm pkgid
    

    In this command,

    pkgid

    Is the name of the software package to be removed from the installed system. For example, SUNWaudio.

  3. Verify that the package has been removed correctly.

    # /usr/sbin/pkgchk pkgid
    

    If the pkgchk command determines that the package is not installed, it will print a warning message.

Example--Removing Software From a System

The following example shows a command to remove the SUNWaudio package from a system. The example also shows the use of the pkgchk command to verify that the package files were removed.

# /usr/sbin/pkgrm SUNWaudio
The following package is currently installed:
   SUNWaudio       Audio applications^M
                   (sparc) 3.0,REV=1.2.13^M

Do you want to remove this package? y
.
.
.
Removal of <SUNWaudio> was successful.
# pkgchk -v SUNWaudio
WARNING: no pathnames were associated with <SUNWaudio>
#