The pkg Interface
Before a software package may
be readily used from within a shell on a
UNIX system, the shell's environment needs to be set up. CTS provides
a simple set of commands, called pkg commands, for adding and removing
packages to and from a shell's environment.
Availability
The pkg commands are currently available only to csh and
tcsh users. If you don't know which shell you use, it's
probably one of those two.
If you use the CTS init System, then you
automatically have access to the pkg commands. If you want to use
the pkg commands without using the init System, you need to do the
following:
- Add these lines to ~/.cshrc or ~/.bashrc:
setenv PKGHOME /pkg/.pkg
source $PKGHOME/lib/pkgsetup
- Create the file ~/.pkgrc, which is a list of
packages to be added automatically every time you log in. The file /pkg/cts/init/default/.pkgrc
is the recommended minimum set of packages, so you might start by
simply copying this file into your home directory.
pkg Commands
In the commands below, list means a list of one or more
package names.
pkgadd list
- Add packages to the environment, letting each package decide
whether to append or prepend to
PATH, MANPATH,
etc.
pkgaddperm list
- Add packages to ~/.pkgrc, which is used to
initialize the environment at login time. Each package decides whether
to add at the beginning or end.
pkgappend list
- Add packages to the environment, appending to paths.
pkgappendperm list
- Add packages at the end of ~/.pkgrc.
pkghelp
- Display a command summary very similar to this one.
pkglist
- List all packages (even ones that are unavailable on the local
machine).
pkgprepend list
- Add packages to the environment, prepending to paths.
pkgrm list
- Remove packages from the environment.
pkgrmperm list
- Remove packages from ~/.pkgrc.
pkgshow
- List the packages in the current environment.
pkgshowperm
- List the packages in ~/.pkgrc.
pkgversion pkg
- List all versions of pkg (even ones that are
unavailable on the local machine).
pkgwhich command
- List the packages containing command.
Notes
Using pkgadd, pkgappend, or
pkgprepend on a package that is already in the current
environment will do nothing but issue a warning. The same goes for
using pkgrm on a package that is not in the current
environment.
pkgwhich checks only the most recent version of the
package. Therefore if there are different versions of the package
for SunOS4 and Solaris machines, its information will be taken from
the Solaris version, even if you are currently logged on to a SunOS4
machine.
If there are any problems, please send mail to bugs.
See Also
CTS Help Center