FreeBSD Ports Collection¶
- ID
ports- Home page
- Platforms
🅱️ BSD (FreeBSD only)
- Operations
installed·outdated·install·upgrade·upgrade_all·remove·sync·cleanup- purl types
pkg:ports- CLI name
make- Forced environment
BATCH=yes- Issues and PRs
- Source
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.
What mpm adds to ports¶
mpm reaches across every manager at once, not ports alone: mpm installed and mpm outdated cover ports alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.
Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.
Your ports commands, in mpm¶
You already know ports: each operation maps one-to-one onto mpm, in an interface shared by every manager.
To… |
With |
With |
|---|---|---|
List what’s installed |
|
|
List outdated packages |
|
|
Install a package |
|
|
Upgrade everything |
|
|
Clear caches |
|
|
Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Operations¶
Operation |
Supported |
|---|---|
|
✓ |
|
✓ |
|
|
|
|
|
✓ |
|
✓ |
|
✓ |
|
✓ |
|
✓ |
|
✓ |
|
Selecting and configuring ports¶
Deselect ports for a single run with --no-ports, or persist the choice in your configuration:
[mpm]
ports = false
The arguments and environment variables listed in the box atop this page are forced on every ports call, so runs stay quiet, non-interactive and reproducible: the defaults you would set in CI anyway.
Keep it enabled but tune how mpm drives it with a per-manager override:
[mpm.managers.ports]
timeout = 900
mpm config-template ports prints every overridable attribute as a ready-to-paste block.
Recipes¶
A few jobs you would otherwise script around ports, one mpm command each:
Snapshot and clone a machine:
mpm --ports dump ports.toml, thenmpm restore ports.tomlon the next one.Export a compliance SBOM:
mpm --ports sbom(CycloneDX by default,--spdxfor SPDX).
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)
A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:
Registry: Source-based recipe trees
Retraction: Index revert of the recipe tree
Publish date: ❌ a recipe carries no publication date
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.
Version probe¶
The version is extracted from the output of make -V .MAKE.VERSION with:
r"(?P<version>\d{8,})"
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
Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --ports installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.
Changelog¶
6.4.0(2026-04-27)Add FreeBSD ports tree manager with
installed,outdated,install,upgrade,upgrade_all,remove,sync, andcleanupsupport. Drivesmake-based source builds out of/usr/ports, delegates registry queries topkg, and usesgitfor tree updates.