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 that are specified on the command line. Note that copying packages to a spool directory is not the same as installing the packages on a system.
Become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Remove any already spooled packages with the same names as the packages you are adding.
For information on removing spooled packages, see Example 20–20.
Add a software package to a spool directory.
# pkgadd -d device-name -s spooldir pkgid ... |
Specifies the absolute path to the software packages. device-name can be the path to a device, a directory, or a spool directory.
Specifies the name of the spool directory where the package will be spooled. You must specify a spooldir.
(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.
Verify that the package has been copied successfully to the spool directory.
$ pkginfo -d spooldir| grep pkgid |
If pkgid was copied correctly, the pkginfo command returns a line of information about the pkgid. Otherwise, the pkginfo command returns the system prompt.
The following example shows how to transfer the SUNWman package from a mounted SPARC based Solaris 10 CD to the default spool directory (/var/spool/pkg).
# pkgadd -d /media/Solaris_11/Product -s /var/spool/pkg SUNWman Transferring <SUNWman> package instance |
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 for 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. 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 |
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. |