Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PKG-UPGRADE(8)		     System Manager's Manual		  PKG-UPGRADE(8)

NAME
     pkg upgrade -- perform upgrades of package software distributions

SYNOPSIS
     pkg upgrade [-fInFqUy] [-r reponame ...] [-Cgix]
	 [<pkg-origin|pkg-name|pkg-name-version> ...]

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

DESCRIPTION
     pkg upgrade is used for upgrading packaged software distributions.

     pkg  upgrade compares the versions of all or specific packages installed on
     the system to what is available in  the  configured  package  repositories.
     Any out of date packages are added to a work list for processing.	The dif-
     ference to pkg-install(8) is that pkg upgrade tries to upgrade dependencies
     of  packages matched as well while pkg-install(8) is more conservative dur-
     ing dependencies upgrade.	Moreover, pkg upgrade will not install new pack-
     ages, except as required to fulfil dependencies of the packages  listed  on
     the  command line.  A caller should ensure that patterns specified as argu-
     ments have installed candidates for matching.  If the -f  (force)	flag  is
     given, all installed packages are added to the work list.

     The  package metadata downloaded from the repositories is then examined for
     each of the packages in the work list, and  any  missing  dependencies  are
     added to the work list as install jobs.  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 up-
     grade of the packages concerned, even  if	subsequently  the  packages  are
     named  explicitly	on a command line.  See pkg-query(8) for finding the au-
     toremoval status of a package, and pkg-set(8) for modifying it.

     Where a package on the work list supplies a shared library,  and  that  li-
     brary  has  been  updated,  all packages requiring that shared library will
     also be added to the work list as reinstallation jobs.

     The work list is sorted into dependency order and pkg upgrade 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
     upgrade is run by a user ID with write access to the package database,  un-
     less  disabled  by  the  -U  flag	or  setting  REPO_AUTOUPDATE  to  NO  in
     pkg.conf(5).

     Finally, the work list is executed in dependency order.  Package  reinstall
     or  update  jobs  are processed by removing the currently installed package
     and immediately installing the replacement.  New dependencies are processed
     as installation jobs as part of the work list.

OPTIONS
     The following options are supported by pkg upgrade:

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

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

     -f, --force
		 Force the reinstallation or upgrade of the whole set  of  pack-
		 ages.	To reinstall a single specific package, prefer using pkg
		 install -f instead.  See pkg-install(8).

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

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

     -i, --case-insensitive
		 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.

     -n, --dry-run
		 Dry-run mode: show what packages have updates available, but do
		 not perform any upgrades.  Repository catalogues  will  be  up-
		 dated as usual unless the -U option is also given.

     -q, --quiet
		 Force	quiet output, except when -n is used, where a summary of
		 the work list is always displayed.

     -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,  ir-
		 respective of the configured "enabled" status from repo.conf.

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

     -v, --vulnerable
		 Upgrade packages which are known to be vulnerable.  See pkg-au-
		 dit(8) for more details.

     -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 installa-
		 tion.

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

     --script-no-exec
		 Do not execute the pre-install, post-install, pre-deinstall, or
		 post-deinstall 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 upgrade.
     See pkg.conf(5) for further description.

     DEFAULT_ALWAYS_YES

     ASSUME_ALWAYS_YES

     HANDLE_RC_SCRIPTS

     PKG_CACHEDIR

     PKG_DBDIR

     REPO_AUTOUPDATE

FILES
     See pkg.conf(5).

SEE ALSO
     pkg_create(3), pkg_printf(3),  pkg_repo_create(3),  pkg_repos(3),	pkg-key-
     words(5),	pkg-lua-script(5),  pkg-repository(5),	pkg-script(5), pkg-trig-
     gers(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-
     install(8), pkg-key(8), pkg-lock(8), pkg-plugins(8), pkg-query(8), pkg-reg-
     ister(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-trig-
     gers(8), pkg-unregister(8), pkg-update(8), pkg-updating(8), pkg-version(8),
     pkg-which(8)

FreeBSD ports 15.quarterly	  July 7, 2024			  PKG-UPGRADE(8)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=pkg-upgrade&manpath=FreeBSD+15.1-RELEASE+and+Ports.quarterly>

home | help