Pkgin

pkgin (https://pkgin.net) 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.

  • -p switches listings to a semicolon-delimited machine format (“name-version;comment”), used for installed and outdated. Plain search output 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 run mpm sync first.

  • 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.

  • Home page: https://pkgin.net

  • Source: meta_package_manager/managers/pkgin.toml

Platforms

  • 🅱️ BSD (NetBSD only)

Operations

Operation

Supported

Notes

installed

outdated

search

exact and extended search backfilled by mpm

install

upgrade

upgrade_all

remove

sync

cleanup

Ecosystem

  • Accepted purl types: pkg:pkgin

Usage

$ mpm --pkgin installed
$ mpm --pkgin search "query"
$ mpm --pkgin upgrade --all
$ mpm install pkg:pkgin/hello
$ mpm --dry-run --pkgin 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-pkgin, disable it from your configuration, or tune its invocation attributes with per-manager overrides.

Command line

  • CLI names, in lookup order: pkgin

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.]+)"

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, 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)

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 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