FreeBSD Ports Collection

FreeBSD ports tree: the source-build workflow rooted at /usr/ports.

Note

Coexists with PKG on the same system: both share the install database maintained by pkg. Ports builds and tracks ports compiled from source under /usr/ports, while PKG handles binary packages from the FreeBSD repository. Listing operations may overlap because pkg does not distinguish ports-built from binary-installed packages once they are registered.

Note

installed and outdated delegate to the sibling pkg binary, since the ports tree keeps no registry of its own. Builds drive FreeBSD’s make directly with BATCH=yes to accept default build options without prompting. Upgrades shell out to the third-party portmaster: the ports tree ships no batch upgrader. sync refreshes the tree with git (portsnap was removed after FreeBSD 13).

Caution

Mutating operations require root privileges and a populated ports tree at /usr/ports. The manager flags itself unavailable when the tree is missing.

Platforms

  • 🅱️ BSD (FreeBSD only)

Operations

Operation

Supported

installed

outdated

search

install

upgrade

upgrade_all

remove

sync

cleanup

Ecosystem

  • Accepted purl types: pkg:ports

Usage

$ mpm --ports installed
$ mpm --ports upgrade --all
$ mpm install pkg:ports/hello
$ mpm --dry-run --ports upgrade --all

Every example above accepts --dry-run, which simulates the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Deselect the manager for a single run with --no-ports, disable it from your configuration, or tune its invocation attributes with per-manager overrides.

Command line

  • CLI names, in lookup order: make

  • Environment forced on each call:

    • BATCH=yes

The version is extracted from the output of make -V .MAKE.VERSION with:

r"(?P<version>\d{8,})"

Privilege escalation

System-wide manager: mpm wraps its privileged operations in sudo out of the box. Instead of letting the tool prompt mid-run, mpm primes the credential cache up-front, with a single branded password prompt at most. Turn escalation off for rootless setups with --no-sudo or the per-manager sudo override.

See privilege escalation for the full policy.

Cooldown

State of FreeBSD Ports Collection’s release-age gating, from the cooldown support table:

  • Status: ❌ None (FreeBSD ports)

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.

Reference traces

Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. If you know FreeBSD Ports Collection well and a transcript below looks wrong, or a newer release changed its output format, report it.

$ pkg query "%n %v %o %c"
curl 8.7.1 ftp/curl Non-interactive tool to get files from FTP/HTTP servers
python311 3.11.9 lang/python311 Interpreted object-oriented programming language
$ pkg version -vIPL=
curl-8.7.1                         <   needs updating (port has 8.8.0)
python311-3.11.9                   <   needs updating (port has 3.11.10)
vim-9.1.0                          =   up-to-date with port