PKG-INSTALL(8)
π PKG-INSTALL(8) β the System Manager's Manual, but make it make sense
okay so bestie, welcome to pkg-install(8) from the System Manager's Manual π this is the page where we install stuff. strap in.
β¨ 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 the whole point of the app basically: it installs packages from package repositories or from local archives. π«Ά You can drop multiple package names on the command line, either explicitly or by matching against package names (or origins) in the repository catalogues using shell globbing or regular expressions.
So here's the whole vibe of what happens, step by step:
one β pkg install first updates any out of date repository catalogues, unless REPO_AUTOUPDATE has been set to NO in pkg.conf. π₯
two β then it creates a work-list of all the package installations to do. Any already installed and up-to-date packages get dropped from the list β unless you supplied the -f (force) option, in which case those packages will be reinstalled. no cap.
three β the dependencies of packages in the list are examined and any missing packages are added to the list for installation. Those implicitly added packages are flagged as candidates for autoremoval. peep pkg-autoremove(8) for the details.
four β hmm, what if a requested package is already installed at the latest version? π then pkg install checks whether its autoremoval flag matches the requested state:
- if
pkg installis run without-Aand the package is marked as automatically installed β the user gets prompted to clear the autoremoval flag. - conversely, if
-Ais specified and the package is not marked as automatic β the user gets prompted to set it.
see pkg-query(8) for finding the autoremoval status of a package, and pkg-set(8) for modifying it. iykyk π
five β any already installed but out of date packages, either named on the command line or from the sum of all their dependencies, get 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.
six β packages are fetched from the repositories into the local package cache if they're 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.
seven β package repository catalogues get automatically updated whenever pkg install is run by a user ID with write access to the package database, unless that's disabled by the -U flag or by setting REPO_AUTOUPDATE to NO in pkg.conf(5).
π OPTIONS π
the following options are supported by pkg install β collect them all:
-A,--automaticβ mark the installed packages as automatic. they'll be automatically removed if no other packages depend on them. for more info pls refer topkg-autoremove(8). π§-C,--case-sensitiveβ makes the standard matching, or the regular expression (-x) matching, against pkg-name case sensitive.-f,--forceβ force the reinstallation of the package if it's already installed. slay, install it again.-g,--globβ treat the package names as shell glob patterns.-I,--no-scriptsβ if any installation scripts (pre-installorpost-install) exist for a given package, do not execute them. and when a package is updated, deinstallation scripts (pre-deinstallorpost-deinstall) are not run either. basically: scripts stay uninvited to the party π-i,--case-insensitiveβ makes the standard matching, or the regular expression (-x) matching, against pkg-name case insensitive. this is the default, unless modified by settingCASE_SENSITIVE_MATCHtotrueinpkg.conf.-M,--ignore-missingβ force the installation of the package with missing dependencies. bold move, iconic energy π-n,--dry-runβ dry-run mode. the list of changes to packages is always printed, but no changes are actually made. we're just window shopping β¨-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-nis used, wherepkg installwill always show packages to be installed, upgraded or deleted.-R,--recursiveβ when used with-f, reinstalls any packages that require the given package.-rreponame,--repositoryreponame β 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 fromrepo.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 ofre_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. no thoughts, just yes.-l,--local-onlyβ skip the remote repository and only install from local archives. also suppresses 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 runningpkg-autoremove(8)after the installation. can also be enabled permanently via theAUTOREMOVEoption inpkg.conf(5). π§Ή--script-no-execβ do not execute thepre-installandpost-installscripts 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-execonly suppresses execution. π subtle but real.
π ENVIRONMENT π
the following environment variables affect the execution of pkg install. see pkg.conf(5) for further description.
DEFAULT_ALWAYS_YESASSUME_ALWAYS_YESCASE_SENSITIVE_MATCHHANDLE_RC_SCRIPTSPKG_CACHEDIRPKG_DBDIRREPO_AUTOUPDATE
π FILES π
see pkg.conf(5). that's it, that's the whole section bestie π
β SEE ALSO β
okay this list is long, but every single one of them matters, so here we go β go read them, i'm obsessed:
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-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-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)
<div align="center">
k byeee, this page is brought to you by Debian, dated July 7, 2024 β go install something cute ππ¦
</div>
π¦ where this page comes from
- nixos 26.05: pkg 2.7.5
- nixpkgs unstable: pkg 2.7.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms