Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
HardenedBSD-pkg docs pkg-install.8
.\"
.\" FreeBSD pkg - a next generation package for the installation and
.\" maintenance of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\"
.\"     @(#)pkg.8
.\"
.Dd July 7, 2024
.Dt PKG-INSTALL 8
.Os
.Sh NAME
.Nm "pkg install"
.Nd install packages from remote repositories or local archives
.Sh SYNOPSIS
.Nm
.Op Fl AfIMnFqRXUy
.Op Fl r Ar reponame ...
.Op Fl Cgix
.Ar <pkg-origin|pkg-name|pkg-name-version> ...
.Pp
.Nm
.Op Cm --{automatic,force,no-scripts,ignore-missing,register-only,autoremove}
.Op Cm --{dry-run,fetch-only,quiet,recursive,no-repo-update,yes}
.Op Cm --repository Ar reponame ...
.Op Cm --{case-sensitive,glob,case-insensitive,regex}
.Ar <pkg-origin|pkg-name|pkg-name-version> ...
.Sh DESCRIPTION
.Nm
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.
.Pp
.Nm
first updates any out of date repository catalogues, unless
.Cm REPO_AUTOUPDATE
has been set to
.Sy NO
in
.Pa pkg.conf .
.Pp
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
.Fl f
(force) option is supplied, in which case those packages will be
reinstalled.
.Pp
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
.Xr pkg-autoremove 8
for details.
.Pp
If a requested package is already installed at the latest version,
.Nm
will check whether its autoremoval flag matches the requested state.
If
.Nm
is run without
.Fl A
and the package is marked as automatically installed,
the user will be prompted to clear the autoremoval flag.
Conversely, if
.Fl A
is specified and the package is not marked as automatic,
the user will be prompted to set it.
See
.Xr pkg-query 8
for finding the autoremoval status of a package, and
.Xr pkg-set 8
for modifying it.
.Pp
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
.Nm
will present it to the user for approval before proceeding, unless
overridden by the
.Fl y
option or the
.Cm ASSUME_ALWAYS_YES
setting in
.Pa pkg.conf .
.Pp
If the vulnerability database
.Pa ( vuln.xml )
is available
.Pq see Xr pkg-audit 8 ,
the summary will flag any packages with known vulnerabilities and
display a warning with the count of affected packages.
.Pp
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
.Xr pkg.conf 5
or in the files in
.Pa /usr/local/etc/pkg/repo .
See
.Xr pkg-repository 5
for details.
.Pp
Package repository catalogues will be automatically updated whenever
.Nm
is run by a user ID with write access to the package database,
unless disabled by the
.Fl U
flag or setting
.Cm REPO_AUTOUPDATE
to
.Sy NO
in
.Xr pkg.conf 5 .
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width automatic
.It Fl A , Cm --automatic
Mark the installed packages as automatic.
Will be automatically removed if no other packages depend on them.
For more information please refer to
.Xr pkg-autoremove 8 .
.It Fl C , Cm --case-sensitive
Make the standard or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case sensitive.
This is the default, unless modified by setting
.Ev CASE_SENSITIVE_MATCH
to false in
.Pa pkg.conf .
.It Fl f , Cm --force
Force the reinstallation of the package if already installed.
.It Fl g , Cm --glob
Treat the package names as shell glob patterns.
.It Fl I , Cm --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.
.It Fl i , Cm --case-insensitive
Make the standard or the regular expression
.Fl ( x )
matching against
.Ar pkg-name
case insensitive.
.It Fl M , Cm --ignore-missing
Force the installation of the package with missing dependencies.
.It Fl n , Cm --dry-run
Dry-run mode.
The list of changes to packages is always printed, but
no changes are actually made.
.It Fl F , Cm --fetch-only
Do not perform actual installation of packages, merely fetch packages
that should be upgraded and detect possible conflicts.
.It Fl q , Cm --quiet
Force quiet output, except when
.Fl n
is used, where
.Nm
will always show packages to be installed, upgraded or deleted.
.It Fl R , Cm --recursive
When used with
.Fl f ,
reinstalls any packages that require the given package.
.It Fl r Ar reponame , Cm --repository Ar 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
.Dq enabled
status from
.Pa repo.conf .
.It Fl U , Cm --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.
.It Fl x , Cm --regex
Treat the package names as regular expressions according to the
"modern" or "extended" syntax of
.Xr re_format 7 .
.It Fl X , Cm --register-only
Record the package installation in the database but do not extract any files.
This also implies
.Fl I .
.It Fl y , Cm --yes
Assume yes when asked for confirmation before package installation.
.It Fl l , Cm --local-only
Skip the remote repository and only install from local archives.
Suppress the automatic update of the repository catalogue.
.It Cm --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
.Xr pkg-autoremove 8
after the installation.
Can also be enabled permanently via the
.Cm AUTOREMOVE
option in
.Xr pkg.conf 5 .
.It Cm --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
.Fl I ,
which prevents scripts from both running and being recorded,
.Cm --script-no-exec
only suppresses execution.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm .
See
.Xr pkg.conf 5
for further description.
.Bl -tag -width ".Ev NO_DESCRIPTIONS"
.It Ev DEFAULT_ALWAYS_YES
.It Ev ASSUME_ALWAYS_YES
.It Ev CASE_SENSITIVE_MATCH
.It Ev HANDLE_RC_SCRIPTS
.It Ev PKG_CACHEDIR
.It Ev PKG_DBDIR
.It Ev REPO_AUTOUPDATE
.El
.Sh FILES
See
.Xr pkg.conf 5 .
.Sh SEE ALSO
.Xr pkg_checksum 3 ,
.Xr pkg_create 3 ,
.Xr pkg_printf 3 ,
.Xr pkg_repo_create 3 ,
.Xr pkg_repos 3 ,
.Xr pkg-keywords 5 ,
.Xr pkg-lua-script 5 ,
.Xr pkg-repository 5 ,
.Xr pkg-script 5 ,
.Xr pkg-triggers 5 ,
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
.Xr pkg-alias 8 ,
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-check 8 ,
.Xr pkg-checksum 8 ,
.Xr pkg-clean 8 ,
.Xr pkg-config 8 ,
.Xr pkg-create 8 ,
.Xr pkg-delete 8 ,
.Xr pkg-fetch 8 ,
.Xr pkg-help 8 ,
.Xr pkg-info 8 ,
.Xr pkg-key 8 ,
.Xr pkg-lock 8 ,
.Xr pkg-plugins 8 ,
.Xr pkg-query 8 ,
.Xr pkg-register 8 ,
.Xr pkg-repo 8 ,
.Xr pkg-repositories 8 ,
.Xr pkg-rquery 8 ,
.Xr pkg-rwhich 8 ,
.Xr pkg-search 8 ,
.Xr pkg-set 8 ,
.Xr pkg-shell 8 ,
.Xr pkg-shlib 8 ,
.Xr pkg-ssh 8 ,
.Xr pkg-stats 8 ,
.Xr pkg-triggers 8 ,
.Xr pkg-unregister 8 ,
.Xr pkg-update 8 ,
.Xr pkg-updating 8 ,
.Xr pkg-upgrade 8 ,
.Xr pkg-version 8 ,
.Xr pkg-which 8