← All Man Pages

ports(8)

integrated, zero-dependency pure-Go CRUX/KryX Linux ports utility (built into kpm)

NAME#

ports - integrated, zero-dependency pure-Go CRUX/KryX Linux ports utility (built into kpm)

SYNOPSIS#

ports [options] command [args...]
kpm ports [options] command [args...]

DESCRIPTION#

ports is the integrated, statically linked (CGO_ENABLED=0) pure-Go ports management utility built directly into kpm(8) (invoked via the /usr/bin/ports multi-call symlink or kpm ports). It replaces CRUX Linux's traditional ports(8) script and the former standalone gports utility with zero external CLI runtime dependencies. All native synchronization protocols (git, rsync, httpup, tarball), Pkgfile metadata parsing, searching, and package database comparisons are implemented natively in Go, while also preserving transparent fallback to classic CRUX /etc/ports/*.{httpup,rsync,git} drivers when /etc/ports/sources.list is not present.

ports shares configuration directly with kpm(8) by reading /etc/kpm.ini (or $KPM_CONFIG) for root, ports_dir, and collections priority order, and by reading CRUX's installed package database (<root>/var/lib/pkg/db) under a shared flock(2) lock on <root>/var/lib/pkg.

COMMANDS#

-u, --update, update [collection ...]
Concurrently synchronize all configured port collections (or only the named collections) using a bounded worker pool. Runs pre-flight DNS and TCP reachability diagnostics before starting workers unless --no-netcheck is passed, and cleanly handles SIGINT / SIGTERM cancellation.
-l, --list, list [collection ...]
List available local ports under ports_dir in CRUX <collection>/<port> format (matching ports -l and kpm list --ports). Pass --collections to display configured collection sync states instead.
-d, --diff, diff [collection ...]
Compare local port versions parsed natively from Pkgfile recipes against installed package versions in <root>/var/lib/pkg/db, honoring kpm.ini collection priority order and numeric-aware version comparison. Prints a Collection Name Port Installed table (including MISSING for installed packages absent from local ports) or No differences found.
-s, --search, search query ...
Perform a fast local case-insensitive substring search across port names, relative paths, and # Description: headers, printing matches as <collection>/<port> <version> - <description>.
status
Inspect configured collections from sources.list without network I/O and print a table of collection name, protocol, destination directory, and local sync status (including short Git HEAD commit and port count).
check
Validate sources.list and sources.list.d/*.list syntax and run pre-flight /etc/resolv.conf, DNS, and TCP connectivity checks without modifying ports_dir.

OPTIONS#

-j, --jobs n
Maximum number of concurrent collection sync workers (default: 4).
-c, --config path
Path to the primary sources.list file (default: $PORTS_CONFIG or /etc/ports/sources.list).
--kpm-config path
Explicit path to kpm(8) INI configuration file (default: $KPM_CONFIG or /etc/kpm.ini).
-r, --root dir
Override [paths] root from kpm.ini when reading var/lib/pkg/db.
-p, --ports-dir dir
Override [paths] ports_dir from kpm.ini (default: $PORTS_DIR, $KPM_PORTS_DIR, $KRYX_PORTS_DIR, or /usr/ports).
--collections
With -l/list, show configured collection sync status (equivalent to ports status).
--no-netcheck
Skip pre-flight DNS and TCP reachability checks before syncing.
-v, --version
Print version information and exit 0.
-h, --help
Print usage summary and exit 0.

CONFIGURATION#

ports reads collection sources from /etc/ports/sources.list and optional drop-in files matching /etc/ports/sources.list.d/*.list (falling back automatically to legacy /etc/gports/sources.list if present). Each non-comment line has the format:

<protocol> <collection> <url> [destination_dir]

ENVIRONMENT#

KPM_CONFIG
Path to kpm.ini (shared with kpm(8)).
PORTS_CONFIG
Override default path to sources.list.
PORTS_DIR, KPM_PORTS_DIR, KRYX_PORTS_DIR
Override default local ports root directory.

FILES#

/etc/ports/sources.list
Primary collection sources list.
/etc/ports/sources.list.d/*.list
Optional drop-in collection definitions loaded in lexicographical order.
/etc/kpm.ini
Shared kpm(8) INI configuration file.
<root>/var/lib/pkg/db
CRUX/kpm installed package database read under a shared flock(2) lock during ports -d.

EXAMPLES#

ports check
ports -u
ports -u -j 2 core opt
ports -l
ports -d
ports -s ripgrep
ports status
kpm ports -u

SEE ALSO#

kpm(8), kpm-index(8), kryx-src(8), pkginfo(8)