PKG-REGISTER(8)
π 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 topkg-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 apkg-pliststyle 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-Moption 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-moption is mutually exclusive with-Mβ οΈ same energy, other direction.-t,--testβ enable testing mode. this allowspkg registerto 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 onpkg(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
- nixos 26.05: pkg 2.7.5
- nixpkgs unstable: pkg 2.7.5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms