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

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
PKG_VERSION(1)          FreeBSD General Commands Manual         PKG_VERSION(1)

NAME
     pkg_version - summarize installed versions of packages

SYNOPSIS
     pkg_version [-cdhv] [-l limchar] [-L limchar] [-s string] [index]
     pkg_version [-t version1 version2]

DESCRIPTION
     The pkg_version command is used to produce a report of non-base software
     packages installed using the pkg_add(1) command.

     Each package's version number is checked against one of two sources to
     see if that package may require updating.  If the package contains
     information about its origin in the FreeBSD ports tree, and a version
     number can be determined from the port's Makefile, then the version
     number from the Makefile will be used to determine whether the installed
     package is up-to-date or requires updating.

     If no origin for a package can be found, or if the port's Makefile cannot
     be located, pkg_version will search for the package in the ports
     collection index file (typically /usr/ports/INDEX).  Any matching version
     number(s) there will be used to determine whether the installed package
     is up-to-date or requires updating.

     Generally, using the version number from a port's Makefile will provide a
     more accurate result, since, unlike the index file, it provides an
     unambiguous current version number, even when multiple versions of a port
     exist in the ports collection.  Moreover, the ports collection index file
     is only updated at intervals, meaning that it may not completely reflect
     the version numbers of the software contained in the ports collection.

     Each package name is printed, along with a one-character status flag:

     =       The installed version of the package is current.

     <       The installed version of the package is older than the current
             version.

     >       The installed version of the package is newer than the current
             version.  This situation can arise with an out-of-date index
             file, or when testing new ports.

     ?       The installed package does not appear in the index.  This could
             be due to an out of date index or a package taken from a PR that
             has not yet been committed.

     *       There are multiple versions of a particular software package
             listed in the index file.  Examples from the FreeBSD ports
             collection are the Tcl toolkit or the EMACS editor.

     !       The installed package exists in the index but for some reason,
             pkg_version was unable to compare the version number of the
             installed package with the corresponding entry in the index.

OPTIONS
     The pkg_version utility supports several command-line arguments:

     -c      Enable commands output.  Commands output includes the commands
             you should type to update your installed packages to the latest
             versions in the ports system.  This feature does not constitute
             an automated packages updating system.  The output of this
             command must be edited, in order to avoid destroying dependencies
             between installed packages.

     -d      Enable debugging output.

     -h      Print help message.

     -l      Limit the output to those packages whose status flag matches the
             character(s) in limchar.  More than one character can be
             specified in limchar.  Note that because some of the status flag
             characters are also special to the shell, it is best to quote
             limchar with single quotes.

     -L      Limit the output to those packages whose status flag doesn't
             match limchar.  You may specify more than one character to match
             in limchar.  Note that because some of the status flag characters
             are also special to the shell, it is best to quote limchar with
             single quotes.

     -s      Limit the output to those packages whose names match a given
             string.

     -t      Test a pair of version number strings and exit.  The output
             consists of one of the single characters = (equal), < (right-hand
             number greater), or > (left-hand number greater) on standard
             output.  This flag is mostly useful for scripts or for testing.

     -v      Enable verbose output.  Verbose output includes some English-text
             interpretations of the version number comparisons, as well as the
             version numbers compared for each package.  Non-verbose output is
             probably easier for programs or scripts to parse.

     index   Specify the index to be used as a basis of comparison.  This
             index can be specified as a filename (in the local filesystem) or
             a URL.  Any URL understandable by fetch(1) can be used here.  If
             no index file is specified on the command line, /usr/ports/INDEX
             is used.

SEE ALSO
     fetch(1), pkg_add(1), pkg_create(1), pkg_delete(1), pkg_info(1)

FILES
     /usr/ports/INDEX  Default index file.

EXAMPLES
     The following is a typical invocation of the pkg_version command, which
     checks the installed packages against the local ports index file:

           % pkg_version -v

     The command below generates a report against the version numbers in the
     on-line ports collection:

           % pkg_version
           ftp://ftp.FreeBSD.org/pub/FreeBSD/branches/-current/ports/INDEX

     The command below generates a file of commands to run to update the
     installed files.  These commands must not be run without suitable
     editing.  They should be treated as suggestions, and may need to be
     reordered to account for dependencies between installed packages, or may
     need to be disregarded if multiple versions of an installed package can
     coexist.  Blindly running the output of this command may leave a system
     in an unusable state.

           % pkg_version -c > do_update

     The following command compares two package version strings:

           % pkg_version -t 1.5 1.5.1

AUTHORS
     Bruce A. Mah <bmah@FreeBSD.org>

CONTRIBUTORS
     Nik Clayton <nik@FreeBSD.org>,
     Dominic Mitchell <dom@palmerharvey.co.uk>,
     Mark Ovens <marko@FreeBSD.org>,
     Doug Barton <DougB@gorean.org>,
     Akinori MUSHA <knu@FreeBSD.org>

BUGS
     The commands output feature is not an automated ports/packages updating
     system.  It does not even attempt to handle dependencies between
     installed packages correctly, and can produce incorrect results if
     multiple versions of a package can coexist on a system.

     Commands output assumes you install new software using the ports system,
     rather than using pkg_add(1).

FreeBSD 11.0-PRERELEASE          July 17, 1998         FreeBSD 11.0-PRERELEASE

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | SEE ALSO | FILES | EXAMPLES | AUTHORS | CONTRIBUTORS | BUGS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=pkg_version&sektion=1&manpath=FreeBSD+4.9-RELEASE>

home | help