pkgadd Installs software packages to the system
pkgrm Removes a package from the system
pkginfo Displays software package information
pkgchk Checks package installation state
pkgtrans Translates packages from one format to another
# more /var/sadm/install/contents ==> to list all installed software packages
# pkginfo | more ==> to display information about installed software packages
# pkginfo -l | more ==> to view additional information
# pkginfo -l SUNWman ==> to view information of a specific package
# pkginfo | wc -l ==> to find how many packages are currently installed
To view information about packages that are located on the DVD
# pkginfo -d /cdrom/cdrom0/s0/Solaris_10/Product | more
# pkginfo -d /cdrom/cdrom0/Solaris_10/Product | more
Checking a Package Installation
The pkgchk command checks to determine if a package has been installed on the system. If the pkgchk command does not display a message, it indicates the package was installed successfully and that no changes have been made
to any ﬁles or directories in the package.
# pkgchk SUNWladm ==> to check the contents & attributes of a currently installed package
# pkgchk -v SUNWladm ==> to list the ﬁles contained in a software package
# pkgchk -p /etc/shadow ==> to find if the contents & attributes of a ﬁle have changed since it was installed with its software package
# pkgchk -l -p /usr/bin/showrev ==> to list information about selected ﬁles that make up a package
# pkgchk -l -P showrev ==> to find if a particular ﬁle is installed & to ﬁnd the directory in which it is located
If -p option is used, the full path must be typed to get information about the ﬁle. If -P option is used, a partial path name can be used.
Adding a Software Package from DVD
Example: To transfer the SUNWvts software package from CD-ROM & install it
# cd /cdrom/cdrom0/Solaris_10/ExtraValue/CoBundled/SunVTS_6.0/Packages
# pkgadd -d . SUNWvts
Adding Packages by Using a Spool Directory
The pkgadd command, by default, looks in the /var/spool/pkg directory for any packages speciﬁed on the command line.
The default directory for packages that have been spooled, but not installed is /var/spool/pkg.
To copy a package from the Solaris DVD into the /var/spool/pkg directory
# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s spool SUNWauda
The -s option with the keyword spool copies the package into the /var/spool/pkg directory by default.
# ls -al /var/spool/pkg ==> to verify if the package exists in the spool directory
# pkgadd SUNWauda ==> to add the package from the spool area
# pkgrm -s spool SUNWauda ==> to remove a package from the spool area
To use an alternative spooling directory
# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s /export/pkg SUNWauda
# pkgrm -s /export/pkg SUNWauda ==> to remove a package from the
Removing a Software Package
Caution – Be cautious of the dependency warnings you receive when removing a package. The system allows you to remove these packages even though they may be required by a different package.
# pkgrm SUNWauda
File system (or Directory) format: Multiple ﬁles and directories.
A package (SUNWrsc) in ﬁle system format:
# ls -ld SUNWrsc
# cd SUNWrsc
# ls -l
Data stream format: Single file.
A package in data stream format:
# ls -l SUNWrsc.pkg
# file SUNWrsc.pkg
# head SUNWrsc.pkg
Translating Package Formats
To translate a package from ﬁle system format in /var/tmp to data stream format
# pkgtrans /var/tmp /tmp/SUNWrsc.pkg SUNWrsc
First argument is the directory where ﬁle system format package is stored. Second argument is the package data stream ﬁle.
Third argument is the package to translate.
If no package name is given a list of all packages in the directory is displayed
# pkgadd -d /tmp/SUNWrsc.pkg all ==> to install packages in a data
To create a data streamed package
# cd /cdrom/cdrom0/s0/Solaris*
# pkgtrans -s Product /var/tmp/stream.pkg SUNWzlib SUNWftpr SUNWftpu
# file /var/tmp/stream.pkg
# head -5 /var/tmp/stream.pkg
# pkgadd -d /var/tmp/stream.pkg