What is portupgrade?

Portupgrade (aka pkgtools) is a tool set for working with ports and packages. It enhances abilities of system tools and adds many new ones. It is highly tunable via its configuration file and allows you to create individual svariable environment for every port you like, to define commands that will be executed before/after port upgrade stages.

pkgtools uses hash databases to keep information about available ports (in the ports tree), installed ports, dependencies, etc. So access to the information is fast. E.g. portversion(1) is much faster than pkg_version(1). (But note: you have to have a fresh INDEX file for relevant results).

pkgtools consist of the utils:

and a few other.


Initially pkgtools was written by Akinori MUSHA <knu@FreeBSD.org>

It is currently maintained by BryanDrewery <bdrewery@FreeBSD.org>

Past Maintainers

These people have maintained the project over time.


Tips and hints for using

    '*' => proc { |origin|

  portsdb -Fu

  portupgrade -a -x ruby -x portupgrade

  pkgdu -tr ruby

  portupgrade -fa -x '>=2008-07-10'


Send your wishes, bug reports to http://github.com/pkgtools/pkgtools or bdrewery@FreeBSD.org

Desired features

From: MatthiasAndree

  • When unregistering a package installed that was installed twice or more often (for me, it happened recently with pkgconfig and pkg-config), pkgdb -F offers to unregister one package's metadata without removing its files. pkgdb -F might however compare the package lists of all packages and remove files that are unique to the package to be deinstalled (i. e. not installed by the package that remains). Example: assume package-1.1 with files a, b, c and package-1.1_4 with files a, c, e are installed. In this case, pkgdb -F could offer to remove "b" if package-1.1 is deinstalled.

  • When unregistering a package that was installed twice or more often, pkgdb -F might count the number of MD5 mismatches of the installed files to figure out which package data is more current or fits the existing installation better, and default to installing metadata with most mismatches.

From: Hannes Hauswedell <hannes.hauswedell at gmail.com>

  • I would wish for portupgrade to automatically meet new requirements upon upgrading. both pkg_add and make install do this, portupgrade should too. Upgrading a port and not installing a new requirement is almost never desired and shouldnt be default. (i.e. -R should not be required for this, instead if at all it should be achieved by -N )
  • When using portupgrade in -P mode it should check dependencies before(!) doing a make install, otherwise requirements will always be installed via source, even though a current package might exist. an example: port A has no package and requires B that does have package. if I portupgrade -P "A" both are installed from source although B could have - and following the manual for -P, should have - been installed via package.

From: RW <list-freebsd-2004 at morbius.sent.com>

  • Portupgrade uses pkg_add -f to install packages. pkg_add is supposed to install the missing dependencies itself, but sometimes they are missing in the repository. Because it uses the -f option pkg_add is able to proceed without the missing dependency. Personally, I think it might be cleaner to drop the -f option and allow the pkg_add to fail.

From: AndrewPantyukhin

  • Deliver SIGSTOP to spawned processes.

From: AlexanderLeidinger

  • option to keep the logs of failed builds/updates (this is not '-L', but similar)
  • parse the output of the install phase and present a list of installed startup scripts before portupgrade exits (hidden behind an option or not)
  • parse the output of the install phase and present a list of all the stuff in the security report before portupgrade exits (only as an option)

From: Chris Calvey <chris at securityforensics.co.uk>

  • A suggestion might be that portupgrade could capture say the kill signal, write its current upgrade tree to disk and exit. On restarting portupgrade, it would re-load the saved tree and continue.

portupgrade (last edited 2012-08-01 18:44:18 by BryanDrewery)