| PORTS(8) | System Manager's Manual | PORTS(8) |
ports — sync,
list, compare and clean port collections
ports |
-u [name ...] |
ports |
-l [collection ...] |
ports |
-d [collection ...] |
ports |
-x[dfsw]
[collection ...] |
ports |
-h | -v |
ports keeps the port collections up to
date and reports on them. Collections are configured by files in
/etc/ports/ ending in .rsync
or .git; see
CONFIGURATION. Files with any other
name, such as the shipped ports.rsync.inactive, are
ignored.
The options are as follows:
-d-h,
--help-l-u
[name ...]-v,
--version-x[dfsw]dfswRequires root.
-l, -d and
-x work on every configured collection: each
collection of an rsync configuration, under its key, and each git
configuration, under its file name. If no configuration is active they use
/ports/core,
/usr/ports/libs,
/usr/ports/devel,
/usr/ports/python,
/usr/ports/perl and
/usr/ports/opt instead. Every directory in
/usr/local/ports/ is a collection as well. Naming
one or more collections restricts them to those.
A directory is a port if it holds a MAKEPKG or a MAKEPKG.lock. The recipe of a port is MAKEPKG.lock if there is one, else MAKEPKG, as for mkpkg(8).
Only the recipes and the files that belong with them are synced. Package archives, source archives, work/ directories and *.lock files are never transferred and never deleted, so locked ports keep their lock; see mkpkg(8). File owners are not copied, and modes become 755 for directories and 644 for files.
With rsync, a port directory that exists upstream is made identical to it. Nothing else in the destination is deleted by the transfer, so a collection may live in a directory it shares with other files, such as /usr/src. A port that upstream no longer has is removed afterwards, but only if its directory holds a MAKEPKG and no MAKEPKG.lock; a locked port is kept and reported. Other directories and files are never touched.
With git, the destination is cloned if it is not a git checkout
yet, and otherwise updated with git pull
--ff-only.
An rsync configuration, /etc/ports/name.rsync, has key=value lines:
hostmoduletokenRSYNC_PASSWORD, as password.A git configuration,
/etc/ports/name.git,
has url, branch, which
defaults to main, and
destination.
Empty lines and lines starting with
‘#’ are ignored.
-d.The ports utility exits 0 on
success, and >0 if an error occurs. -u
fails if any collection failed to sync.
An rsync configuration with two collections:
host=rsync.rawnix.org module=ports token=YOUR_TOKEN core=/ports/core linux=/usr/src
Sync only the core collection:
# ports -u core| September 27, 2026 | mkpkg 1.6.0 |