LinuxCommandLibrary

pkgadd

Install software packages (primarily Solaris)

TLDR

Install a local software package

$ pkgadd [package]
copy

Update an already installed package from a local package
$ pkgadd -u [package]
copy

SYNOPSIS

pkgadd [-d device] [-R root_path] [-s spool_dir] [-a admin_file] [-r response_file] [-n] [-q] [-G] [-x] [-V version] pkg_id [pkg_id...]
pkgadd -s spool_dir -d device [pkg_id]

PARAMETERS

-d device
    Specifies the source device or directory for the package (e.g., tape, CD-ROM, local path).

-R root_path
    Specifies an alternate root path (chroot environment) where the package should be installed instead of the default '/'. Used for non-global zones or system imaging.

-s spool_dir
    Spools the package to a specified directory on the local system before installation. This allows for package storage and later installation without the original media.

-a admin_file
    Specifies an administrative file to override default installation behaviors, such as prompting for package information or handling of file conflicts.

-r response_file
    Provides a response file containing answers to questions that pkgadd might pose during installation, enabling unattended installations.

-n
    Non-interactive mode. Assumes 'no' to any questions that would typically require user input, often leading to installation abortion if input is mandatory.

-q
    Quiet mode. Suppresses most output during the installation process, useful for scripting or automated deployments.

-G
    Do not install package group dependencies. Only the specified package will be installed, ignoring any declared dependencies on other packages within the same group.

-x
    Executes pre-installation and post-installation scripts in a non-trusted shell environment, providing additional security by limiting their capabilities.

-V version
    Specifies the SVR4 version of the package format. Rarely used explicitly as pkgadd typically detects it.

pkg_id
    One or more unique identifiers of the package(s) to be added. This is the primary argument to specify which package to install.

DESCRIPTION

pkgadd is a command used to install software packages onto a System V Release 4 (SVR4) compliant Unix system. Unlike Linux, which predominantly uses package managers like APT (Debian/Ubuntu), RPM (Red Hat/CentOS/Fedora), or pacman (Arch Linux), pkgadd is not a standard command found on most Linux distributions. Its primary home is on systems such as Solaris, HP-UX, and older versions of AIX, which adhere to the SVR4 packaging standard.

The packages managed by pkgadd are typically found in a specific directory structure containing metadata files (pkginfo) and scripts (preinstall, postinstall, preremove, postremove) that automate the installation and configuration process. When executed, pkgadd prompts the user for information where necessary, verifies package integrity, and executes any associated installation scripts. It handles the placement of files, creation of symbolic links, and updates system records to track installed components.

pkgadd can install packages from various media, including tape drives, CD-ROMs, network file systems, or local directories. It also supports "spooling" packages, which involves copying the package to a local disk area before installation, allowing for offline installation or easier management of multiple installations. Its design reflects a time when software distribution was more standardized across different Unix vendors under the SVR4 initiative. Understanding pkgadd is crucial when working with legacy System V Unix environments, or when porting applications from such systems.

CAVEATS

Not a native Linux command: pkgadd is primarily found on System V Release 4 (SVR4) Unix systems such as Solaris, HP-UX, and older AIX versions. It is not part of standard Linux distributions (which use APT, RPM, dnf, zypper, etc.) and will not be available unless specifically ported or if you are on a very specialized Linux variant aiming for SVR4 compatibility.
Package Format Dependency: It only works with packages formatted according to the SVR4 packaging standard, which differs significantly from common Linux package formats (.deb, .rpm).
Security Implications: Packages can contain pre-install and post-install scripts that run with elevated privileges. Always ensure the package source is trusted.

USAGE CONTEXT

You would typically encounter pkgadd when working with legacy System V Unix systems (e.g., Solaris 10 and earlier, some HP-UX or AIX environments), or in very specific cross-platform scenarios where SVR4 package formats are still used. It is not relevant for most modern Linux administrative tasks.

SVR4 PACKAGE STRUCTURE

An SVR4 package is essentially a directory structure, or a file stream, containing various components:
- pkginfo: A mandatory file containing package metadata (name, version, architecture, dependencies).
- install scripts: Optional scripts like preinstall, postinstall, preremove, postremove that automate setup or teardown tasks.
- reloc: A directory for relocatable files.
- root: A directory for absolute path files.
- Other control files.

HISTORY

The pkgadd command is a core component of the System V Release 4 (SVR4) packaging system, which was developed in the late 1980s by AT&T and Sun Microsystems as an attempt to standardize Unix operating systems and their software management practices. It was designed to provide a robust and portable method for installing and managing software across diverse SVR4-compliant Unix platforms. While it was widely adopted on systems like Solaris, HP-UX, and older AIX versions, its influence on Linux was indirect. Linux distributions later developed their own, more advanced package management systems (RPM, APT) that drew on some concepts but diverged significantly in implementation and package formats. Therefore, pkgadd's history is tied to the evolution of Unix rather than Linux directly.

SEE ALSO

pkginfo(1), pkgrm(1), installf(1M), removef(1M), dpkg(1), rpm(8), apt-get(8), yum(8), dnf(8)

Copied to clipboard