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

FreeBSD Manual Pages

  
 
  

home | help
PKG_REPLACE(1)		     General Commands Manual		  PKG_REPLACE(1)

NAME
     pkg_replace -- a utility for upgrading installed packages

SYNOPSIS
     pkg_replace [-abBcCddfFhiJknNOpPPqrRRuUvVwW] [--all] [--automatic]
		 [--batch] [--backup-package | --no-backup-package]
		 [--clean | --no-clean] [--cleanup | --no-cleanup]
		 [--config | --no-config] [--force-config | --no-force-config]
		 [--debug] [--makedb] [--cleandb] [--updatedb | --no-updatedb]
		 [--no-backup] [--no-configfile] [--vebose | --no-verbose]
		 [--version] [-j jobs] [-l file] [-L prefix] [-m make_args]
		 [-M make_env] [-t make_target] [-x pkgname] [-X pkgname]
		 [[pkgname[=package]] [package] [glob] [pkgorigin] ...]

DESCRIPTION
     The pkg_replace command is used to upgrade installed packages.

OPTIONS
     The following options are supported:

     -a, --all
	      Do with all the installed packages.

     --automatic
	      Set automatic flag for the package.  This affects the operation of
	      pkg-autoremove(8).

     -B, --no-backup
	      Do not backup old packages before uninstall old packages.

     -b, --backup-package
	      Keep backup packages of the old versions.  By default, the created
	      backup  package  will  be  deleted  after installation.  See also,
	      --no-backup-package

     --no-backup-package
	      Do not  keep  backup  packages  the  old	versions.   Override  -b
	      --backup-package.

     --batch  Run an upgrading process in a batch mode (with BATCH=yes).

     -c, --config
	      Do "make config-conditional" before build.  See also, --no-config.

     --no-config
	      Do not "make config-conditional" bofore build.  Override --config.

     -C, --force-config
	      Do "make config" before build.  See also, --no-force-config.

     --no-force-config
	      Do not "make config" bofore build.  Override --force-config.

     --clean  Do "make clean" before build.  See also, -w, --no-clean.

     --cleanup
	      Do  "make clean" after build.  This is the default.  See also, -W,
	      --no-cleanup.

     -d, -R   In addition to the specified packages, replace all  packages  that
	      required by those packages as well.

     -dd, -RR
	      Strictly checking dependencies more than -d, -R, e.g. build depen-
	      dencies.	 However,  this  mode  is slow.  So, pkg_replace creates
	      cache files that record dependencies in the PKG_REPLACE_DB_DIR di-
	      rectory  to  run	as  fast  as   possible.    See   config   file,
	      pkg_replace.conf.sample.	 If you set --cleandb, pkg_replace clean
	      these files in the PKG_REPLACE_DB_DIR.

	      This option may fail when there  are  dependency	problems  (e.g.,
	      packages	have  looped  dependencies,  packages  removed the ports
	      tree).  Especially, be careful when using -a option  at  the  same
	      time.

	      When package foo and bar have loop dependencies, specifying -x foo
	      excludes foo from the dependency check using the option -dd.

     --debug  Debug mode.  Execute with "set -x" option.

     -F       Fetch distfiles or packages, do not replace.

     -f       Force to replace packages.

     -h       Show help and exit.

     -i       Turn on interactive mode.

     -J       Do not install the target packages, but install the dependencies.

     -j jobs  Number  of  parallel  jobs.   Default  value  gets from `sysctl -n
	      hw.ncpu`.

     -k       Force the upgrade of a package even if some of the requisite pack-
	      ages have failed to upgrade in advance.

     -L PREFIX
	      Save the logs in the files that begins with PREFIX.

     -l FILE  Save the results to FILE.  By default, pkg_replace does  not  save
	      results.

     -m ARGS  Specify  arguments  to append to each make(1) command.  Please see
	      section EXAMPLES.

     --makedb
	      Create cache files only that record dependencies	of  packages  in
	      the PKG_REPLACE_DB_DIR.

     --cleandb
	      Clean    cache	files	 that	record	 dependencies	in   the
	      PKG_REPLACE_DB_DIR.  This option should be useful when the  depen-
	      dencies of packages are new or modified.	See also, -dd, -RR.

     --updatedb
	      Update	cache	 files	 that	record	 dependencies	in   the
	      PKG_REPLACE_DB_DIR.  This is the default.  See also, -dd, -RR.

     --no-updatedb
	      Do not update cache files in the PKG_REPLACE_DB_DIR.  This  option
	      overrides --updatedb.  See also, -dd, -RR.

     -M ARGS  Specify arguments to prepend to each make(1) command.

     -N       Install new packages, do not replace.

     -n       Do not actually replace any packages.

     --no-configfile
	      Do not read the configuration file pkg_replace.conf.

     -O       Do not check the dependencies before building the target packages.

     -P       Use   binary   packages	instead   of   installing  from  source.
	      pkg_replace  finds  them	 from	the   directory   specified   by
	      PKGREPOSITORY, and the remote site specified by PACKAGEROOT.

     -PP      Be  forced  to  use binary packages.  Never use the port even if a
	      package is not available either locally or remotely.

     -p       Do "make package".

     -r       In addition to the specified packages, replace all  packages  that
	      depend on those packages as well.

     -t make_target
	      Do "make make_target" only.

     -U       Unlock  packages before deinstall packages and lock packages again
	      after install.

     -u       Do not preserve old shared  libraries.   By  default,  pkg_replace
	      preserves  old  shared  libraries in PKGCOMPATDIR.  But if the new
	      library and the old library have the same name, the old library is
	      removed from PKGCOMPATDIR.

     -V       List the installed packages that need updating.

     -v, --verbose
	      Turn on verbose output.

     --no-verbose
	      Turn off verbose output.	Override -v, --verbose.

     --version
	      Print pkg_replace version.

     -W, --no-cleanup
	      Do not "make clean" after each installation.  See also, --cleanup

     -w, --no-clean
	      Do not "make clean" before each build.  This is the default.   See
	      also, --clean

     -X glob  Remove  the libraries in PKGCOMPATDIR, when the specified packages
	      have the libraries with the same name as the one in  PKGCOMPATDIR.
	      This  may  be useful when there are errors due to a mixture of old
	      and new libraries.

     -x glob  Do not replace packages matching the specified glob pattern.

	      When package foo and bar have loop dependencies, specifying -x foo
	      excludes foo from the dependency check using the option -dd.

VARIABLES
     See also, pkg_replace.conf.

     PACKAGEROOT	 Default is https://pkg.FreeBSD.org.

     PKGCOMPATDIR	 Defaut location is /usr/local/lib/compat/pkg.

     PKGREPOSITORY	 Default location is /var/cache/pkg/All.

     PKG_REPLACE_DB_DIR  Default location is /var/db/pkg_replace.

EXAMPLES
     *	 pkgname and glob examples: name-version, name and shell glob.

	       glib-2.36.3_2, glib and 'glib*' or glib\*

     *	 pkgorigin examples: pkgorigin and pkgorigin@flavor.

	       devel/glib20 and graphics/py-cairo@py37

     *	 Path: Absolute and relative paths are allowed.

	       pkg_replace glib=../glib20-new
	       or
	       pkg_replace glib=/home/foo/ports/glib20

     *	 Install glib:

	       pkg_replace -N devel/glib20

     *	 Install py-cairo with FLAVOR=py37:

	       pkg_replace -N graphics/py-cairo@py37

     *	 Replace glib:

	       pkg_replace glib

     *	 Replace perl and all packages that depend on it:

	       pkg_replace -r perl

     *	 If the xterm package is already installed, replace it with xterm-220:

	       pkg_replace /usr/ports/packages/All/xterm-220.tbz

     *	 Replace XFree86-libraries with /usr/ports/x11/xorg-libraries:

	       pkg_replace XFree86-libraries=/usr/ports/x11/xorg-libraries

     *	 Replace XFree86-libraries with pkgorigin: x11/xorg-libraries:

	       pkg_replace XFree86-libraries=x11/xorg-libraries

     *	 Replace XFree86-libraries with /var/tmp/xorg-libraries-6.9.0 package:

	       pkg_replace XFree86-libraries=/var/tmp/xorg-libraries-6.9.0.tbz

     *	 Replace graphics/py-cairo with FLAVOR=py37:

	       pkg_replace -m FLAVOR=py37 graphics/py-cairo
	       or
	       pkg_replace graphics/py-cairo@py37

     *	 Do "make configure" only:

	       pkg_replace -t configure pkgname

COMPATIBILITY
     The portupgrade(1) options -A, -B, -D, -e, -o, -q, -s, -S	and  -y  are  no
     longer supported.

SEE ALSO
     portupgrade(1), pkg(8), ports(7),

AUTHORS
     Securedog <securedog@users.sourceforge.jp>
     Ken DEGUCHI <kdeguchi@sz.tokoha-u.ac.jp>

BUGS
     Sure to be some.

FreeBSD ports 15.quarterly	February 9, 2026		  PKG_REPLACE(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=pkg_replace&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help