DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

pkgadd(1M)


pkgadd -- transfer software package or set to the system

Synopsis

   pkgadd [-b bufsize] [-d device] [-r response] [-n] [-q] [-l] [-a admin] [-p] [pkginst ...]
   

pkgadd -s spool [-b bufsize] [-d device] [-q] [-l] [-p] [pkginst ...]

pkgadd -v

Description

pkgadd transfers the contents of a software package or set from the distribution medium or directory to install it onto the system. [For installation over a network, use pkginstall(1M).]

A package is a collection of related files and executables that can be independently installed. A set is made up of a special-purpose package, referred to as a Set Installation Package (SIP), and a collection of one or more packages that are members of the set. The SIP controls the installation of the set.

pkgadd checks that all packages listed on the command line are on the installation medium. If any of the packages listed does not exist, no changes are made to the system, that is, none of the listed packages are installed.

Used without the -d option, pkgadd looks in the default spool directory for the package (/var/spool/pkg). Used with the -s option, it writes the package to a spool directory instead of installing it.

Error messages are always logged (see -l, below). In addition, when pkgadd terminates, it will send mail (by default, to root) with all the error messages and a summary of which packages installed completely, partially, or not at all. The following options are available.


-b bufsize
Specifies the buffer size passed to cpio to copy a package image from a device (such as a tape drive) to a temporary work area on disk. By default, the buffer size is taken from /etc/device.tab; and, if this value fails, the command is re-tried with a buffer size of 512. The -b option overrides the value in /etc/device.tab; if the buffer size you supply fails, the command is attempted again with a buffer size of 512.

-d device
Installs or copies a package/set from device. device can be: (a) the full pathname to a directory, file, or named pipe (such as /var/tmp); (b) the device identifiers for tape or disk devices (such as /dev/rmt/* or /dev/dsk/*) [see intro(7)]; (c) a device alias (such as diskette1); or (d) ``"-"'' which specifies packages in datastream format read from standard input. The default device is the installation spool directory (/var/spool/pkg).

For device identifiers, the device specified (either by pathname or alias), must have an entry in the device table (/etc/device.tab). If no entry exists in the device table, pkgadd will abort.

A device alias is the unique name by which a device is known. (For example, the alias for a cartridge tape drive might be ctape1.) The name must be limited in length to 64 characters (DDB_MAXALIAS) and can contain only alphanumeric characters and/or any of the following special characters: underscore (``_''), dollar sign (``$''), hyphen (``-''), and period (``.''). No two devices in the database can share the same alias.


-r response
Identifies a file or directory, response, which contains the answers to questions posed by a ``request script'' during a previous pkgask session conducted in interactive mode [see pkgask(1M)]. When pkginst is a package, response can be a full pathname or a directory; when pkginst is a SIP, response must be a directory. For a complete description of request scripts and response files, see your system administration or software packaging guides.

-n
Installation occurs in non-interactive mode. The default mode is interactive.

-q
Installation is performed in quiet mode. Package installation scripts that implement QUIETMODE for user input requests will require no user intervention during installation. See ``Notes''.

-l
Error messages are not sent to the standard error output; they are only logged to /var/sadm/install/logs/pkginst.log.

-a admin
Defines an installation administration file, admin, to be used in place of the default administration file to specify whether installation checks (such as the check on the amount of space, the system state, and so on) are done. [For a description of the format of an admin file, see admin(4).] The token none overrides the use of any admin file, and thus forces interaction with the user. Unless a full pathname is given, pkgadd looks in the /var/sadm/install/admin directory for the file. By default, the file default in that directory is used. default specifies that no checking will be done, except to see if there is enough room to install the package and if there are dependencies on other packages. The -a option cannot be used if pkginst is a SIP.

-p
Do not give the initial prompt to the user to insert the distribution medium. All other prompts will continue normally.

pkginst
A short string used to designate an abbreviation for the package/set name. (The term ``package instance'' is used loosely: it refers to all instantiations of pkginst.) See pkginfo(1) and pkginfo(4).

If pkginst is a SIP, the SIP controls installation of the set by using request scripts and preinstall scripts. The SIP request script, not the package installation tools, is responsible for prompting the user for responses and taking the appropriate actions. If the request script fails, only the SIP will be processed. For a complete description of request and preinstall scripts, see your system administration and/or software packaging guides.

To indicate all instances of a package, specify 'pkginst.*', enclosing the command line in single quotes, as shown, to prevent the shell from interpreting the * character. Use the token all to refer to all packages available on the source medium.


-s spool
Reads the package into the directory spool instead of installing it.

-v
Displays the version string of pkgadd.

Usage

You must be root to run pkgadd from the command line.

The -r option can be used to indicate a directory name as well as a filename. The directory can contain numerous response files, each sharing the name of the package with which it should be associated. This would be used, for example, when adding multiple interactive packages with one invocation of pkgadd. Each package that had a request script would need a response file. If you create response files with the same name as the package (for example, package1 and package2) then, after the -r option, name the directory in which these files reside.

The -n option will cause the installation to halt if any interaction is needed to complete it.

When invoked with no pkginst specified on the command line, pkgadd only displays the names of sets if at least one SIP exists on the media. Because of this, you shouldn't include packages on the same media if some are members of sets and some are not. If you do, the packages which are not members of sets can be installed only if their pkginst names are provided on the command line.

The pkgadd command checks to see if any of the files in pkginst are already installed on the system and, if any are, saves this fact before continuing with installation. Later, pkgadd won't reinstall these files on the system. If one of the package's installation scripts removes such a file, the result will be that the file will no longer be on the system when package installation completes.

The pkgadd command does not uncompress any files that were already compressed (that is, only those in ".Z" form) before being processed by pkgmk.

pkgadd may display the following message before exiting:

   UX:mailx: WARNING: No message
This is harmless and may be ignored.

Files


/etc/device.tab
device table

/var/sadm/install/admin/default
default package administration file

/var/sadm/install/logs/pkginst.log
error message log

/var/spool/pkg
default spool directory

/usr/lib/locale/locale/LC_MESSAGES/uxpkg
language-specific message file [See LANG on environ(5).]

Exit codes


0
Successful completion of script.

1
Fatal error. Installation process is terminated at this point.

2
Warning or possible error condition. Installation will continue. A warning message will be displayed at the time of completion.

3
Script was interrupted and possibly left unfinished. Installation terminates at this point.

4
Script was suspended (administration). Installation terminates at this point.

5
Script was suspended (interaction was required). Installation terminates at this point.

10
System should be rebooted when installation of all selected packages is completed. (This value should be added to one of the single-digit exit codes described above.)

20
The system should be rebooted immediately upon completing installation of the current package. (This value should be added to one of the single-digit exit codes described above.)

77
No package was selected for the set.

99
Internal error.

References

admin(4), compver(4), copyright(4), depend(4), installf(1M), intro(7), pkgask(1M), pkgchk(1M), pkginfo(1), pkginfo(4), pkginstall(1M), pkgmap(4), pkgparam(1), pkgrm(1M), putdev(1M), removef(1M), setinfo(4), space(4)

Notes

The following is an example of implementing QUIETMODE in package installation scripts. This code, included in a package's request, preinstall, postinstall, preremove, or postremove scripts, will not be executed when the -q option is used:
   if [ "$QUIETMODE" = "false" ]
   then
           echo
           echo "Do you want to continue?"
           echo
   	read RESPONSE
   fi

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004