PKG-INSTALL(8)          FreeBSD System Manager's Manual         PKG-INSTALL(8)

NAME

     pkg install - install packages from remote repositories or local archives

SYNOPSIS

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

     pkg install [--{automatic,force,no-scripts,ignore-missing,register-only,autoremove}]
                 [--{dry-run,fetch-only,quiet,recursive,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 package
     repositories 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.

     If a requested package is already installed at the latest version, pkg
     install will check whether its autoremoval flag matches the requested
     state.  If pkg install is run without -A and the package is marked as
     automatically installed, the user will be prompted to clear the
     autoremoval flag.  Conversely, if -A is specified and the package is not
     marked as automatic, the user will be prompted to set it.  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.

     If the vulnerability database (vuln.xml) is available (see pkg-audit(8)),
     the summary will flag any packages with known vulnerabilities and display
     a warning with the count of affected packages.

     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 automatic.  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.  This is the default, unless
                modified by setting CASE_SENSITIVE_MATCH to false in pkg.conf.

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

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

     -I, --no-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-insensitive
                Make the standard or the regular expression (-x) matching
                against pkg-name case insensitive.

     -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, --recursive
                When used with -f, reinstalls any packages that require the
                given package.

     -r reponame, --repository reponame
                Install packages from only the named repository.  This option
                can be specified multiple times to use several repositories.
                Packages will be fetched from the named repositories only,
                irrespective of the configured "enabled" 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).

     -X, --register-only
                Record the package installation in the database but do not
                extract any files.  This also implies -I.

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

     -l, --local-only
                Skip the remote repository and only install from local
                archives.  Suppress the automatic update of the repository
                catalogue.

     --autoremove
                After installing the requested packages, automatically remove
                any orphaned packages that were installed as dependencies and
                are no longer required.  This is equivalent to running
                pkg-autoremove(8) after the installation.  Can also be enabled
                permanently via the AUTOREMOVE option in pkg.conf(5).

     --script-no-exec
                Do not execute the pre-install and post-install scripts but
                still log the scripts in the package database for future
                reference.  Unlike -I, which prevents scripts from both
                running and being recorded, --script-no-exec only suppresses
                execution.

ENVIRONMENT

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

     DEFAULT_ALWAYS_YES

     ASSUME_ALWAYS_YES

     CASE_SENSITIVE_MATCH

     HANDLE_RC_SCRIPTS

     PKG_CACHEDIR

     PKG_DBDIR

     REPO_AUTOUPDATE

FILES

     See pkg.conf(5).

SEE ALSO

     pkg_checksum(3), pkg_create(3), pkg_printf(3), pkg_repo_create(3),
     pkg_repos(3), pkg-keywords(5), pkg-lua-script(5), pkg-repository(5),
     pkg-script(5), pkg-triggers(5), pkg.conf(5), pkg(8), pkg-add(8),
     pkg-alias(8), pkg-annotate(8), pkg-audit(8), pkg-autoremove(8),
     pkg-check(8), pkg-checksum(8), pkg-clean(8), pkg-config(8),
     pkg-create(8), pkg-delete(8), pkg-fetch(8), pkg-help(8), pkg-info(8),
     pkg-key(8), pkg-lock(8), pkg-plugins(8), pkg-query(8), pkg-register(8),
     pkg-repo(8), pkg-repositories(8), pkg-rquery(8), pkg-rwhich(8),
     pkg-search(8), pkg-set(8), pkg-shell(8), pkg-shlib(8), pkg-ssh(8),
     pkg-stats(8), pkg-triggers(8), pkg-unregister(8), pkg-update(8),
     pkg-updating(8), pkg-upgrade(8), pkg-version(8), pkg-which(8)

FreeBSD 15.1-STABLE-HBSD         July 7, 2024                   PKG-INSTALL(8)