PKG-INSTALL(8)

πŸ“¦ version 2.7.5, in nixos 26.05, nixpkgs unstable

πŸ’… 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 install is run without -A and the package is marked as automatically installed β†’ the user gets prompted to clear the autoremoval flag.
  • conversely, if -A is 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 to pkg-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-install or post-install) exist for a given package, do not execute them. and when a package is updated, deinstallation scripts (pre-deinstall or post-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 setting CASE_SENSITIVE_MATCH to true in pkg.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 -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. 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 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. πŸ’€ subtle but real.

🌈 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). 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:


<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