Pkgin¶
- ID
pkgin- Home page
- Platforms
🅱️ BSD (NetBSD only)
- Operations
installed·outdated·search·install·upgrade·upgrade_all·remove·sync·cleanup- purl types
pkg:pkgin- CLI name
pkgin- Issues and PRs
- Source
pkgin is the binary package manager for pkgsrc, NetBSD’s portable package collection (also used on illumos/SmartOS, macOS and Linux).
Parsing notes, verified against the pkgin 26.4.0 source (main.c, pkglist.c, messages.h) and its man page:
Global flags precede the command word (
pkgin -y install foo); pkgin has no long options at all.-pswitches listings to a semicolon-delimited machine format (“name-version;comment”), used for installed and outdated. Plainsearchoutput is parsed with a fused “name-version” split on the last dash before a digit (pkgsrc versions may carry an “nbN” revision suffix, like “lbdb-0.48.1nb1”).-l '<'filters the listing to packages whose installed version is older than the repository’s, printing the available version: a non-mutating outdated listing. It reflects the local summary database, so runmpm syncfirst.Every non-empty search ends with a three-line “=:/<:/>:” legend footer, which matches nothing in the regex and is skipped.
Queries run unprivileged on the existing database; every mutating command (including
update, which rebuilds the database) needs root.
What mpm adds to pkgin¶
Through mpm, pkgin gains --exact and --extended search, to narrow to exact names or match descriptions.
Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover pkgin 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 pkgin commands, in mpm¶
You already know pkgin: 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 |
|
|
Search for a package |
|
|
Install a package |
|
|
Upgrade one package |
|
|
Upgrade everything |
|
|
Remove a package |
|
|
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 |
Notes |
|---|---|---|
|
✓ |
|
|
✓ |
|
|
||
|
✓ |
exact and extended search backfilled by |
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
Selecting and configuring pkgin¶
Deselect pkgin for a single run with --no-pkgin, or persist the choice in your configuration:
[mpm]
pkgin = false
Keep it enabled but tune how mpm drives it with a per-manager override:
[mpm.managers.pkgin]
timeout = 900
mpm config-template pkgin prints every overridable attribute as a ready-to-paste block.
Recipes¶
A few jobs you would otherwise script around pkgin, one mpm command each:
Snapshot and clone a machine:
mpm --pkgin dump pkgin.toml, thenmpm restore pkgin.tomlon the next one.Export a compliance SBOM:
mpm --pkgin 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.
Root is required for its cleanup_cache, install, remove, sync, upgrade, upgrade_all operations.
See privilege escalation for the full policy.
Cooldown¶
State of Pkgin’s release-age gating, from the cooldown support table:
Status: ❌ None (pkgsrc binary packages)
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: Distro binary archives (
pkg:deb,pkg:rpm,pkg:alpm,pkg:apk)Retraction: Index revert: removal is an archive operation and the mirror is rebuilt without the package. Debian, for one, requires filing an
RM:bug againstftp.debian.org(developers-reference)Publish date: ❌ the version string is the distro maintainer’s build, carrying no upstream 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 probed by running:
$ pkgin -v
pkgin 26.4.0 (using SQLite 3.45.1)
and extracted with:
r"pkgin (?P<version>[\d.]+)"
Reference traces¶
Raw native outputs captured in the bundled definition: the reference mpm’s parsers were written against. If you know Pkgin well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ pkgin -p list
lbdb-0.48.1nb1;The little brother's database
mutt-1.14.5;Text-based MIME mail client
$ pkgin -p -l < list
abook-0.6.2;<;Text-based addressbook program
$ pkgin search {query}
abook-0.6.1 Text-based addressbook program
mutt-1.14.5 = Text-based MIME mail client
=: package is installed and up-to-date
<: package is installed but newer version is available
>: installed package has a greater version than available package
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 --pkgin installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.
Changelog¶
7.2.0(2026-07-09)Add pkgin (NetBSD pkgsrc) package manager with
installed,outdated,search,install,upgrade,remove,syncandcleanupsupport; a bundled configuration-defined manager.