PKG-UNREGISTER(8)

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

okay bestie, pull up a chair πŸ’… this is pkg unregister from section 8 of the System Manager's Manual β€” yes, the big scary one, but it's literally just the "delete package records" girlie and she's very good at her job. let's get into it 🫢


✨ NAME ✨

pkg unregister β€” deletes package records from the database πŸ—‘οΈβœ¨


🌸 SYNOPSIS 🌸

pkg unregister [-fnqRy] [-Cgix] pkg-name ...
pkg unregister [-nqy] -a
pkg unregister [--{force,dry-run,quiet,recursive,yes}]
    [--{case-sensitive,glob,case-insensitive,regex}] pkg-name ...
pkg unregister [--{dry-run,quiet,yes}] --all

πŸ¦‹ DESCRIPTION πŸ¦‹

so pkg unregister deletes installed packages from the database. like, records β€” she's doing db surgery, not touching your files, ok? 🩺✨

here's the flow: she builds a work-list of every installed package that matches the package names you gave her on the command line, then she shows you that list. if you confirm you actually wanna remove those packages from the db β€” or if the ASSUME_ALWAYS_YES configuration option is set β€” she goes ahead and removes the listed packages from the db. easy πŸ’–

now, the dependency tea β˜•: if unregistering your set of packages would leave other installed packages with unfulfilled dependencies, pkg unregister will add those dependency-having packages to the list of packages to be unregistered too β€” unless you force her to proceed without unregistering any other packages using the -f option. she's not gonna leave anyone stranded, fr fr 😭

and this is important, bestie β€” she avoids deleting herself unless she's named specifically on the command line. so for example, pkg unregister -a will unregister all packages from the db except the pkg(8) package. if you truly want all packages unregistered from the db without exception, use pkg unregister -fa. πŸ”₯ (yeah, she'll take herself out too. main character energy πŸ’€)


πŸ’– OPTIONS πŸ’–

the following options are supported by pkg unregister:

  • -a, --all β€” deletes all installed packages from the db except for pkg(8), and cleans the database of information related to the removed packages. the full send 🧹✨
  • -C, --case-sensitive β€” makes the standard or regular expression (-x) matching against pkg-name case sensitive. uppercase girlies respect uppercase πŸ’…
  • -f, --force β€” forces packages to be removed from the db even though that leaves unresolved dependencies behind. combined with the -a or --all flag, it causes pkg(8) to be removed as well as all the other packages. no survivors πŸ’€πŸ”₯
  • -g, --glob β€” treats the package names as shell glob patterns. * girlies rise 🌟
  • -i, --case-insensitive β€” makes the standard or regular expression (-x) matching against pkg-name case insensitive. this is the default, unless it's been modified by setting CASE_SENSITIVE_MATCH to true in pkg.conf. lowercase supremacy πŸ“
  • -n, --dry-run β€” dry run mode. the list of packages to delete is always printed, but no packages are actually deleted. window shopping only πŸ›οΈπŸ‘€
  • -q, --quiet β€” forces quiet output, except where -n is also used β€” in that case pkg unregister will show the list of packages to be deleted. shhh 🀫
  • -R, --recursive β€” delete all packages that require the listed packages as well. it's giving "you come with your friends" 😭🫢
  • -x, --regex β€” treats the package names as regular expressions according to the "modern" or "extended" syntax of re_format(7). fancy matching hours πŸ§šβ€β™€οΈ
  • -y, --yes β€” assume yes when asked for confirmation before package deletion. no thoughts, just yes ✨

πŸŽ€ ENVIRONMENT πŸŽ€

the following environment variables affect how pkg unregister runs. see pkg.conf(5) for further description, iykyk πŸ“–

  • DEFAULT_ALWAYS_YES
  • ASSUME_ALWAYS_YES
  • HANDLE_RC_SCRIPTS
  • PKG_DBDIR
  • CASE_SENSITIVE_MATCH

πŸ“ FILES πŸ“

see pkg.conf(5). that's it, that's the whole section, she's concise 🌸


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group showed up for this one, obsessed 🫢🌈

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-register(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-update(8), pkg-updating(8), pkg-upgrade(8), pkg-version(8), pkg-which(8)


and that's the whole page, bestie β€” go unregister something responsibly πŸ’œ

this one came from Debian, dated December 13, 2025 β€” yeah she's fresh, slay πŸŽ€βœ¨

πŸ“¦ where this page comes from