FreeBSD pkg¶
FreeBSD’s binary pkg frontend, fetching pre-compiled artifacts from the official FreeBSD repository.
Note
outdated parses pkg upgrade --dry-run rather than pkg version,
because only the dry-run names the target version each package would move
to.
Caution
sync forces IGNORE_OSVERSION=yes: a package built for a newer
FreeBSD than the running kernel would otherwise trigger an interactive
confirmation that hangs the subprocess. Honoring that variable is also why
the version floor is 1.11.
Home page: https://github.com/freebsd/pkg
Version requirement:
>=1.11
Platforms¶
🅱️ BSD (FreeBSD only)
Operations¶
Operation |
Supported |
|---|---|
|
✓ |
|
✓ |
|
✓ |
|
✓ |
|
✓ |
|
✓ |
|
✓ |
|
✓ |
|
✓ |
Ecosystem¶
Accepted purl types:
pkg:pkg
Usage¶
$ mpm --pkg installed
$ mpm --pkg search "query"
$ mpm --pkg upgrade --all
$ mpm install pkg:pkg/hello
$ mpm --dry-run --pkg 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-pkg, disable it from your configuration, or tune its invocation attributes with per-manager overrides.
Command line¶
CLI names, in lookup order:
pkgArguments forced before each call:
--quiet
The version is extracted from the output of pkg --version with:
r"(?P<version>\S+)"
Privilege escalation¶
mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.
See privilege escalation for the full policy.
Cooldown¶
State of FreeBSD pkg’s release-age gating, from the cooldown support table:
Status: ❌ None
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 pkg well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ pkg query "%n %v %c"
7-zip 21.07_2 Console version of the 7-Zip file archiver
ap24-mod_mpm_itk 2.4.7_2 Run each vhost under a separate uid and gid
apache24 2.4.57 Version 2.4.x of Apache web server
aquantia-atlantic-kmod 0.0.5_1 Aquantia AQtion (Atlantic) Network Driver
arcconf 3.07.23971,1 Adaptec SCSI/SAS RAID administration tool
areca-cli-amd64 1.14.7.150519,1 Command Line Interface for ARC-xxxx RAID
base64 1.5_1 Utility to encode and decode base64 files
bash 5.1.12 GNU Project's Bourne Again SHell
beadm 1.4_1 Solaris-like utility to manage Boot Environments on ZFS
$ pkg upgrade --dry-run
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (312 candidates): 100%
Processing candidates (312 candidates): 100%
The following 466 package(s) will be affected (of 0 checked):
Installed packages to be REMOVED:
freenas-files: 13.0_1700495253
py39-midcli: 20190509171453
py39-middlewared: 13.0_1700495253
New packages to be INSTALLED:
abseil: 20230125.3 [FreeBSD]
argp-standalone: 1.5.0 [FreeBSD]
brotli: 1.1.0,1 [FreeBSD]
Installed packages to be UPGRADED:
7-zip: 21.07_2 -> 23.01 [FreeBSD]
apache24: 2.4.57 -> 2.4.58_1 [FreeBSD]
apr: 1.7.0.1.6.1_1 -> 1.7.3.1.6.3_1 [FreeBSD]
aquantia-atlantic-kmod: 0.0.5_1 -> 0.0.5_2 [FreeBSD]
bash: 5.1.12 -> 5.2.21 [FreeBSD]
$ pkg version --like "<"
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
7-zip-21.07_2 <
apache24-2.4.57 <
apr-1.7.0.1.6.1_1 <
aquantia-atlantic-kmod-0.0.5_1 <
bash-5.1.12 <