PKG-REGISTER(8)

πŸ“¦ version 2.7.5, in nixos 26.05, nixpkgs unstable

πŸ’– PKG-REGISTER πŸ’–

okay bestie, so this is pkg register β€” a System Manager's Manual situation, and it's literally the little command that writes down what got installed. let's get into it 🫢


✨ NAME ✨

pkg register β€” register a package into the local package database

like, it's the one that makes the package official. the paperwork era of package management πŸ“‹


🌸 SYNOPSIS 🌸

pkg register [-dltN] [-f plist-file] -m metadatadir -i input-path
pkg register [-dltN] -M metadatafile

pkg register [--{debug,test,no-registration}] [--relocate location]
    [--plist plist-file] --metadata metadatadir --root input-path
pkg register [--{debug,test,no-registration}] [--relocate location]
    --manifest metadatafile

(and yes, -l shows up in -dltN up there β€” no cap, it's in the synopsis, that's just how it is πŸ’…)


πŸ¦‹ DESCRIPTION πŸ¦‹

so pkg register is used for registering a package into the local package database. that's the whole vibe.

here's the tea: pkg register assembles a full set of package metadata from whatever inputs it can get its hands on, and then writes all that metadata into the package registry database. it's genuinely one of the final steps when you're installing software from ports β€” the package files get installed into the filesystem first, and then pkg register gets called to record what was installed into the package database. the receipts, basically. 🧾✨

pkg register can derive package metadata from a number of different sources:

  • The package manifest
  • The metadata directory
  • Direct analysis of files installed by the package

πŸŽ€ the manifest situation

the package manifest is a UCL format listing of package metadata. it can contain all of the necessary metadata the package needs β€” but the more usual approach is to provide selected items via the manifest, and fill in the rest either from legacy files such as pkg-plist, +DESC, +DISPLAY or +MESSAGE, which are optional and mostly located in the metadatadir given as the argument to the -m option. like bringing a snack to a potluck instead of the whole meal πŸ“

🧚 the analysis situation

other information about shared library requirements and the packages necessary to provide them may be obtained by direct analysis of the files installed by the package. and listen β€” file checksums may be left blank in the input metadata, because all checksums will be recalculated from the installed or staged files, overwriting the input. yeah, it just fixes them for you, obsessed. this is the mechanism currently used when installing software directly from the ports tree, since it provides reasonable backwards compatibility with the old style pkg_add(1) command. nostalgia-core 😭

reading in a complete and comprehensive manifest from one file is a simpler alternative β€” but it requires all the metadata to have been assembled beforehand. no shortcuts, bestie.

πŸ’€ the -t warning

direct analysis of the installed files can be suppressed by use of the -t option. this is intended for testing the functionality of pkg(8) itself, and should not be routinely used. that's a "do not casually touch this" moment, fr fr πŸ™ˆ


πŸ’… OPTIONS πŸ’…

the following options are supported by pkg register:

  • -A, --automatic β€” mark the package to be automatically removed if no other packages depend on it. for more info please refer to pkg-autoremove(8). it's giving "no strings attached" πŸŽ€
  • -d, --debug β€” enable debugging output. turn the lights on so you can see what's happening ✨
  • -N, --no-registration β€” disable registration in the package database; the files will be installed, the scripts will be executed. so like, everything happens except the paperwork. iconic loophole honestly πŸ’€
  • -f plist-file, --plist plist-file β€” specifies a pkg-plist style packing list file πŸ“‹
  • -i input-path, --root input-path β€” specifies the package input path or staging directory. this is where the stuff lives before it's official πŸ¦‹
  • -M manifest, --manifest manifest β€” specifies the package manifest file. use of this option means that the only file which will be used as a source of package metadata is the named manifest file. and heads up: the -M option is mutually exclusive with -m ⚠️ they cannot both come to the party.
  • -m metadatadir, --metadata metadatadir β€” specifies the metadata directory to use when registering the package. this directory will hold the package manifest, and optionally may contain a number of other old-style metadata input files. the -m option is mutually exclusive with -M ⚠️ same energy, other direction.
  • -t, --test β€” enable testing mode. this allows pkg register to update the package database without performing any of the usual analyses of files installed by the package. > this option should only be used with caution, and preferably only for the intended purpose of performing regression tests on pkg(8) itself. not a main character move to use this casually, ngl πŸ”₯
  • --relocate location β€” annotates the package as having been relocated to location, which is an alternate system root. this is an experimental feature and intended for cross-architecture package management. there is no corresponding single letter option. (DEPRECATED) πŸ’€πŸ«Ά

🌈 ENVIRONMENT 🌈

the following environment variables affect the execution of pkg register. see pkg.conf(5) for further description.

  • PKG_DBDIR

that's the whole list, bestie β€” short and sweet πŸ“


⭐ FILES ⭐

see pkg.conf(5). yeah, that's it. go look πŸ‘€


πŸ‘‘ SEE ALSO πŸ‘‘

pkg_create(3), pkg_printf(3), pkg_repo_create(3), pkg_repos(3), pkg-keywords(5), pkg-lua-script(5), pkg-repository(5), pkg-script(5), pkg-triggers(5), pkg.conf(5), pkg(8), pkg-add(8), pkg-alias(8), pkg-annotate(8), pkg-audit(8), pkg-autoremove(8), pkg-check(8), pkg-clean(8), pkg-config(8), pkg-create(8), pkg-delete(8), pkg-fetch(8), pkg-help(8), pkg-info(8), pkg-install(8), pkg-key(8), pkg-lock(8), pkg-plugins(8), pkg-query(8), pkg-repo(8), pkg-repositories(8), pkg-rquery(8), pkg-search(8), pkg-set(8), pkg-shell(8), pkg-shlib(8), pkg-ssh(8), pkg-stats(8), pkg-triggers(8), pkg-unregister(8), pkg-update(8), pkg-updating(8), pkg-upgrade(8), pkg-version(8), pkg-which(8)

like a whole friend group in there, honestly 🫢✨


sign-off time, bestie: this one's from the Debian system, dated March 22, 2023 β€” and it's the PKG-REGISTER(8) page of the System Manager's Manual. periodt πŸ’œ
πŸ“¦ where this page comes from