PKG-INSTALL(8)

NAME
pkg install - installs packages from remote package repositories or local archives

SYNOPSIS
pkg install [-AfIMnFqRUy] [-r reponame] [-Cgix] <pkg-origin|pkg-name|pkg-name-version> ...

pkg install [--{automatic,force,no-install-scripts,ignore-missing}] [--{dry-run,fetch-only,quiet,from-root,no-repo-update,yes}] [--repository reponame] [--{case-sensitive,glob,case-insensitive,regex}] <pkg-origin|pkg-name|pkg-name-version> ...

DESCRIPTION
pkg install is used for installation of packages from a package repository or local archives. Multiple package names can be specified on the command line, either explicitly or by matching against package names (or origins) in the repository catalogues using shell globbing or regular expressions.

pkg install first updates any out-of-date repository catalogues, unless REPO_AUTOUPDATE has been set to NO in pkg.conf.

It then creates a work-list of all the package installations to do. Any already installed and up-to-date packages will be dropped from the list unless the -f (force) option is supplied, in which case those packages will be reinstalled.

The dependencies of packages in the list are examined and any missing packages are added to the list for installation. Such implicitly added packages are flagged as candidates for autoremoval. See pkg-autoremove(8) for details.

Autoremoval flags are sticky, and will persist over reinstallation or upgrade of the packages concerned, even if subsequently the packages are named explicitly on a command line. See pkg-query(8) for finding the autoremoval status of a package, and pkg-set(8) for modifying it.

Any already installed but out of date packages, either named on the command line or from the sum of all their dependencies are added to the work list as upgrade jobs. The work list is sorted into dependency order and pkg install will present it to the user for approval before proceeding, unless overridden by the -y option or the ASSUME_ALWAYS_YES setting in pkg.conf.

Packages are fetched from the repositories into the local package cache if they are not already present, or if the checksum of the cached package file differs from the one in the repository. Packages may be downloaded from any of the repositories mentioned in pkg.conf(5) or in the files in /usr/local/etc/pkg/repo. See pkg-repository(5) for details.

Package repository catalogues will be automatically updated whenever pkg install is run by a user ID with write access to the package database, unless disabled by the -U flag or setting REPO_AUTOUPDATE to NO in pkg.conf(5).

OPTIONS
The following options are supported by pkg install:

-A, --automatic
    Mark the installed packages as orphan. Will be automatically removed if no other packages depend on them. For more information please refer to pkg-autoremove(8)

-C, --case-sensitive
    Make the standard or the regular expression (-x) matching against pkg-name case sensitive.

-f, --force
    Force the reinstallation of the package if already installed.

-g, --glob
    Treat the package names as shell glob patterns.

-I, --no-install-scripts
    If any installation scripts (pre-install or post-install) exist for a given package, do not execute them. When a package is updated, deinstallation scripts (pre-deinstall or post-deinstall) are not run either.

-i, --case-sensitive
    Make the standard or the regular expression (-x) matching against pkg-name case insensitive. This is the default, unless modified by setting CASE_SENSITIVE_MATCH to true in pkg.conf.

-M, --ignore-missing
    Force the installation of the package with missing dependencies.

-n, --dry-run
    Dry-run mode. The list of changes to packages is always printed, but no changes are actually made.

-F, --fetch-only
    Do not perform actual installation of packages, merely fetch packages that should be upgraded and detect possible conflicts.

-q, --quiet
    Force quiet output, except when -n is used, where pkg install will always show packages to be installed, upgraded or deleted.

-R, --from-root
    When used with -f, reinstalls any packages that require the given package.

-r reponame, --repository reponame
    Install packages from only the named repository, irrespective of the configured “active” status from repo.conf.

-U, --no-repo-update
    Suppress the automatic update of the local copy of the repository catalogue from remote. Automatic repository catalogue updates are only attempted when the effective UID of the process has write access to the package database. Otherwise they are silently ignored.

-x, --regex
    Treat the package names as regular expressions according to the "modern" or "extended" syntax of re_format(7).

-y, --yes
    Assume yes when asked for confirmation before package installation.

ENVIRONMENT
The following environment variables affect the execution of pkg install. See pkg.conf(5) for further description.

ASSUME_ALWAYS_YES

CASE_SENSITIVE_MATCH

HANDLE_RC_SCRIPTS

PKG_CACHEDIR

PKG_DBDIR

REPO_AUTOUPDATE

FILES
See pkg.conf(5).

SEE ALSO
pkg_printf(3), pkg_repos(3), pkg-repository(5), pkg.conf(5), pkg(8), pkg-add(8), pkg-annotate(8), pkg-audit(8), pkg-autoremove(8), pkg-backup(8), pkg-check(8), pkg-clean(8), pkg-config(8), pkg-convert(8), pkg-create(8), pkg-delete(8), pkg-fetch(8), pkg-info(8), pkg-lock(8), pkg-query(8), pkg-register(8), pkg-repo(8), pkg-rquery(8), pkg-search(8), pkg-set(8), pkg-shell(8), pkg-shlib(8), pkg-ssh(8), pkg-stats(8), pkg-update(8), pkg-updating(8), pkg-upgrade(8), pkg-version(8), pkg-which(8)