// vim: set et sw=4 ts=8 ft=asciidoc tw=80:
port-upgrade(1)
===============

NAME
----
port-upgrade - Upgrade a port to the latest version

SYNOPSIS
--------
[cmdsynopsis]
*port* [*-vdqysbckpotf*] [*-D* 'portdir'] *upgrade*
     [--enforce-variants] [--force] [--no-replace] [--no-rev-upgrade]
     [['portname' | 'pseudo-portname' | 'port-expressions' | 'port-url']]
     [+/-variant ...]

DESCRIPTION
-----------
*port upgrade* will upgrade the given installed ports to the latest available
version. To upgrade a port, MacPorts needs an updated port definition, which can
be obtained using the man:port-selfupdate[1] command. You should regularly run
*selfupdate* followed by *upgrade outdated* to make sure your system has the
latest versions and bug fixes.

When specifying variants during upgrade, the order of precedence is

. variants specified on the command line
. variants active in the latest installed version of the port
. variants specified in man:variants.conf[5]

In most cases, you should specify the *outdated* pseudo-port expression as
argument to *port upgrade* to upgrade all ports where a newer version is
available. This is the recommended upgrade method for end users.
See man:port[1] for more information on pseudo-port expressions.
Upgrading individual packages should only be performed by expert users who
know what they are doing, since a mix of upgraded and non-upgraded packages
can lead to various software errors.

OPTIONS
-------
*--enforce-variants*::
    Upgrade all given ports and their dependencies where the installed variants
    do not match those requested on the command line, even if those ports aren't
    outdated.

*--force*::
    Ignore circumstances that would normally cause ports to be skipped, such as
    not being outdated.

*--no-replace*::
    Do not automatically install ports that replace a now-obsolete port you have
    installed.

*--no-rev-upgrade*::
    Do not run rev-upgrade after upgrading. See man:port-rev-upgrade[1] for more
    information.


include::global-flags.txt[]

*-f*::
    Upgrade a port, even if it is not outdated.

*-n*::
    Only upgrade the given ports and avoid upgrading their dependencies. This
    flag may be useful when combined with *--enforce-variants*.
    +
    WARNING: Ports expect their dependencies to always be at the latest version,
    which is why MacPorts upgrades dependencies first. Do not specify this flag
    if you don't know what you are doing.

*-p*::
    Keep going and attempt to upgrade the next port when a port fails to build.
    +
    WARNING: This option is harmful to *upgrade* and should be avoided at all
    cost. Often, MacPorts ports are only upgraded to rebuild them against
    updated dependencies. Specifying this flag will cause a spurious rebuild if
    a dependency of a port fails to build and leave your system in a broken
    state once the dependent port is fixed.

SEE ALSO
--------
man:port[1], man:port-uninstall[1], man:port-info[1], man:port-variants[1],
man:port-rev-upgrade[1], man:port-setrequested[1], man:variants.conf[5]

AUTHORS
-------
 (C) 2015 The MacPorts Project
 Clemens Lang <cal@macports.org>
