PKG-LOCK(8)

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

πŸ’… pkg lock / pkg unlock β€” system manager's manual (PKG-LOCK(8))

okay so bestie, listen up β€” this is the manual page for pkg lock and pkg unlock, and it's literally the ✨ main character energy ✨ of package management on your system. no cap, if you've ever wanted to just freeze a package in place so nothing touches it, this is your moment. periodt.


🌸 NAME 🌸

pkg lock, pkg unlock β€” lock or unlock packages. that's it. that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

pkg lock [-lqy] [-a]
pkg lock [-lqy] [-Cgix] pkg-name ...
pkg unlock [-lqy] [-a]
pkg unlock [-lqy] [-Cgix] pkg-name ...

pkg lock [--{show-locked,quiet,yes}] [--all]
pkg lock --has-locked-packages
pkg lock [--{show-locked,quiet,yes}]
    [--{case-sensitive,glob,case-insensitive,regex}] pkg-name ...
pkg unlock [--{show-locked,quiet,yes}] [--all]
pkg unlock [--{show-locked,quiet,yes}]
    [--{case-sensitive,glob,case-insensitive,regex}] pkg-name ...

okay so that looks like a lot of brackets, but honestly it's giving "i have options and i'm not afraid to use them." πŸ’…


πŸ”₯ DESCRIPTION πŸ”₯

pkg lock is the tool you use to lock packages against reinstallation, modification, or deletion. pkg unlock does the opposite β€” it unlocks the named packages. either variant only has an effect on currently installed packages. so real talk: you can't block installation of a brand-new package using this mechanism, unless that installation would imply updating a locked package. sorry bestie, that's just how it is. 😭

the impact of locking a package is wider than just "don't touch this one package." any operation that implies modification of the locked package will be blocked. and when i say any, i mean:

  • attempts to reinstall, upgrade, downgrade, or delete the locked package itself. literally leave it alone. 🫢
  • installation, upgrade, or downgrade of a package where the resultant package would have a dependency on a different version of the locked package. yeah, dependencies are messy like that.
  • deletion, upgrade, or downgrade of any package the locked package depends upon, either directly or as a consequence of installing or upgrading some third package. the whole tree gets protective energy. 🌳
⚠️ so basically, locking one package is giving "you shall not pass" to a whole chain of operations. plan accordingly, bestie.

πŸ’– OPTIONS πŸ’–

the following options are supported by pkg lock:

  • -a, --all β€” lock or unlock all installed packages. all of them. every single one. no survivors. πŸ‘‘
  • -C, --case-sensitive β€” make the standard or the regular expression (-x) matching against pkg-name case sensitive. so Foo and foo are NOT the same vibe. respect the case. πŸ” 
  • -g, --glob β€” treat pkg-name as a shell glob pattern. like * and ? and all that jazz. ✨
  • -i, --case-insensitive β€” make the standard or the regular expression (-x) matching against pkg-name case insensitive. this is the default, unless modified by setting CASE_SENSITIVE_MATCH to true in pkg.conf. so yeah, Foo and foo are besties by default. 🫢
  • -l, --show-locked β€” show a list of all locked packages. this can be used without locking or unlocking any packages, in which case privileged access to the package database is not required. otherwise it will be displayed after any lock or unlock operations. so you can peek at the locked list without sudo. iconic. πŸ‘€
  • -q, --quiet β€” operate quietly: do not output anything other than confirmatory questions. so no extra chatter. just the essentials. 🀫
  • -x, --regex β€” treat pkg-name as a regular expression according to the "modern" or "extended" syntax of re_format(7). get your regex on. πŸ”£
  • -y, --yes β€” assume "yes" as the answer to all questions. no take-backs. no second thoughts. just yes. βœ…
  • --has-locked-packages β€” return 0 if at least one package is locked, 1 otherwise. perfect for scripting. exit status realness. πŸ’€

🌈 ENVIRONMENT 🌈

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

  • PKG_DBDIR
  • DEFAULT_ALWAYS_YES
  • ASSUME_ALWAYS_YES
  • CASE_SENSITIVE_MATCH

these are the vibes that influence how pkg lock behaves. iykyk. 🧚


πŸŽ€ FILES πŸŽ€

see pkg.conf(5). that's where the file info lives. go check it out. πŸ¦‹


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

like, that's a whole friend group of man pages. go say hi. πŸ‘‹


πŸ’œ this page is from Debian, dated March 19, 2024. system manager's manual, PKG-LOCK(8). stay slay, stay locked, and don't let anyone touch your packages without permission. periodt. πŸ’…βœ¨
πŸ“¦ where this page comes from