Previous Table of Contents Next


Listing Packages

If you need to check which packages are installed on a system, use the pkginfo command. By default, it displays information about currently installed packages. You can also use the pkginfo command to display packages that are on mounted distribution media.

Use the command pkginfo with no arguments to list all installed packages. The following example shows the first few packages from a system:

[48]castle{winsor}% pkginfo
system      SUNWadmap      System & Network Administration Applications
system      SUNWadmfw      System & Network Administration Framework
system      SUNWadmr       System & Network Administration Root
system      SUNWarc        Archive Libraries
system      SUNWaudio      Audio Applications
system      SUNWbcp        Binary Compatibility
system      SUNWbtool      CCS tools bundled with SunOS
system      SUNWcar        Core Architecture, (Root)
(Additional packages not shown in this example)

You can display information about a single package by using the following syntax:

pkginfo pkgid

In the following example, information is displayed for the SUNWsteNP package:

oak% pkginfo SUNWsteNP
application SUNWsteNP      NeWSprint
oak%

To display information about packages on a CD-ROM, mount the CD-ROM (see the instructions at the end of Chapter 12). Then use the following syntax to display a complete list of packages on the CD-ROM:

oak% pkginfo -d /cdrom/cdrom-name

You can display information about single packages on a CD-ROM using the following syntax:

oak% pkginfo -d /cdrom/cdrom-name pkgid

Removing Packages

Under previous releases of SunOS, you could remove unbundled software packages using the rm(1) command. With Solaris 2.x system software, you should always use the pkgrm command to remove packages. The pkgrm command makes administration easier by removing a complete unbundled package with a single command.

Use the following syntax to remove a package in interactive mode:

# /usr/sbin/pkgrm pkgid

In the following example, the package SUNWdiag is removed:

oak% su
Password:
# pkgrm SUNWdiag

The following package is currently installed:
   SUNWdiag        Online Diagnostics Tool
           (sparc) 2.1

Do you want to remove this package [y,n,?,q] y

## Removing installed package instance <SUNWdiag>
## Verifying package dependencies.
## Processing package information.
## Removing pathnames in <none> class
/opt/SUNWdiag/lib/libtest.a
/opt/SUNWdiag/lib
/opt/SUNWdiag/include/sdrtns.h
/opt/SUNWdiag/include
/opt/SUNWdiag/bin/what_rev
/opt/SUNWdiag/bin/vmem
/opt/SUNWdiag/bin/tapetest
/opt/SUNWdiag/bin/sunlink
/opt/SUNWdiag/bin/sundials
/opt/SUNWdiag/bin/sundiagup
/opt/SUNWdiag/bin/sundiag.info
/opt/SUNWdiag/bin/sundiag
/opt/SUNWdiag/bin/sunbuttons
/opt/SUNWdiag/bin/sptest
/opt/SUNWdiag/bin/revision_ref_file
/opt/SUNWdiag/bin/rawtest
/opt/SUNWdiag/bin/prp
/opt/SUNWdiag/bin/probe
/opt/SUNWdiag/bin/pmem
/opt/SUNWdiag/bin/nettest
/opt/SUNWdiag/bin/music.au
/opt/SUNWdiag/bin/mptest
/opt/SUNWdiag/bin/lpvitest
/opt/SUNWdiag/bin/isdntest
/opt/SUNWdiag/bin/gttest.data
/opt/SUNWdiag/bin/gttest
/opt/SUNWdiag/bin/fstest
/opt/SUNWdiag/bin/fputest
/opt/SUNWdiag/bin/fbtest
/opt/SUNWdiag/bin/dispatcher
/opt/SUNWdiag/bin/diagscrnprnt
/opt/SUNWdiag/bin/cg6test
/opt/SUNWdiag/bin/cg12.data.gsxr
/opt/SUNWdiag/bin/cg12.data
/opt/SUNWdiag/bin/cg12
/opt/SUNWdiag/bin/cdtest
/opt/SUNWdiag/bin/cbrtest
/opt/SUNWdiag/bin/bpptest
/opt/SUNWdiag/bin/autest.data
/opt/SUNWdiag/bin/autest
/opt/SUNWdiag/bin/audbri
/opt/SUNWdiag/bin/57fonts.4ØØ
/opt/SUNWdiag/bin/57fonts.3ØØ
/opt/SUNWdiag/bin
/opt/SUNWdiag
## Updating system information.

Removal of <SUNWdiag> was successful.
#

To remove a package in noninteractive mode, use the -n option with the pkgrm command, as shown here:

# /usr/sbin/pkgrm -n pkgid

To remove a package that was spooled to a directory, use the -s option with the pkgrm command, as shown here:

# /usr/sbin/pkgrm -s spooldir [ pkgid ]

In this example, spooldir is the name of the spool directory to which the unbundled package was spooled and pkgid is the name of the package specified for removal. When you do not supply a package identifier, pkgrm interactively prompts you to remove or preserve each package listed in the spool directory.

Package System Log File

The package commands maintain a list of installed packages in the /var/sadm/install/contents file. No tools are available to list the files contained in a package. The following example shows the first ten lines of the /var/sadm/install/contents file:

oak% head contents
/bin=./usr/bin s none SUNWcsr
/dev d none Ø775 root sys SUNWcsr SUNWcsd
/dev/conslog=../devices/pseudo/log:conslog s none SUNWcsd
/dev/console=../devices/pseudo/cn:console s none SUNWcsd
/dev/dsk d none Ø775 root sys SUNWcsd
/dev/fd d none Ø775 root sys SUNWcsd
/dev/ie=../devices/pseudo/clone:ie s none SUNWcsd
/dev/ip=../devices/pseudo/clone:ip s none SUNWcsd
/dev/kmem=../devices/pseudo/mm:kmem s none SUNWcsd
/dev/ksyms=../devices/pseudo/ksyms:ksyms s none SUNWcsd
oak%

If you need to determine which package contains a particular file, you can use the grep command to search the package system file. In the following example, using the grep command to search for information about the pkgadd command shows that the command is part of the SUNWcsu package and is located in /usr/sbin. A manual page for the pkgadd command is part of the SUNWman package, and is located in /usr/share/man/man1m.

oak% grep pkgadd /var/sadm/install/contents
/usr/sbin/pkgadd f none 0500 root sys 77472 53095 733241518 SUNWcsu
/usr/share/man/man1m/pkgadd.1m f none 0444 bin bin 3784 63018 732833371
SUNWman
# Last modified by pkgadd for SUNWsteNP package
oak%


Previous Table of Contents Next