DNF-VERSIONLOCK(8)
π DNF-VERSIONLOCK(8) π
ok so real quick β this is the dnf-versionlock page from the dnf-plugins-core fam, and bestie, if you've ever had a package get updated out from under you at the worst possible moment, this plugin is literally your new main character. let's get into it π«Ά
β¨ NAME β¨
dnf-versionlock β the DNF versionlock Plugin, aka the bouncer at the club door of your package versions π
πΈ DESCRIPTION πΈ
okay so versionlock is a plugin that takes a set of names and versions for packages and excludes all other versions of those packages. it's giving "you shall not pass" energy. this lets you protect packages from being updated by newer versions. iconic behavior honestly π
alternately, it accepts a specific package version to exclude from updates, e.g. for when it's necessary to skip a specific release of a package that has known issues. like yeah we're not touching that one, thank u π
the plugin provides a command versionlock which allows you to view and edit the list of locked packages easily. lowkey convenient fr fr.
the plugin will walk each line of the versionlock file, and parse out the name and version of the package. it will then exclude any package by that name that doesn't match one of the versions listed within the file. this is basically the same as using dnf --exclude for the package name itself (as you cannot exclude installed packages), but dnf will still see the versions you have installed/versionlocked as available so that dnf reinstall will still work, etc. so yes bestie, reinstall still slays π
it can also work in the opposite way, like a fast exclude, by prefixing a '!' character to the version recorded in the lock list file. this specifically excludes a package that matches the version exactly. precision β¨
heads up bestie: note the versionlock plugin does not apply any excludes in non-transactional operations likerepoquery,list,info, etc. those are just looky-loo operations, no locking there π
π¦ SYNOPSIS π¦
dnf versionlock [options] [add|exclude|list|delete|clear]
[<package-name-spec>]
π ARGUMENTS π
<package-name-spec>β the package spec to lock or exclude. that's it, that's the whole vibe π«Ά
β SUBCOMMANDS β
dnf versionlock add <package-name-spec>
add a versionlock for all available packages matching the spec. it means that only versions of packages represented by <package-name-spec> will be available for transaction operations. each <package-name-spec> is converted to concrete NEVRAs which are used for locking. the NEVRAs to lock to are first searched among installed packages and then (if none is found) in all currently available packages. so it checks your installed stuff first, then your repos, in that order π
examples, because we love receipts π§Ύ
locking a package to the version installed:
$ dnf repoquery --installed bash
bash-0:5.0.7-1.fc30.x86_64
$ dnf repoquery bash
bash-0:5.0.2-1.fc30.i686
bash-0:5.0.2-1.fc30.x86_64
bash-0:5.0.7-1.fc30.i686
bash-0:5.0.7-1.fc30.x86_64
$ dnf versionlock add bash
Adding versionlock on: bash-0:5.0.7-1.fc30.*
locking a not-installed package to any of the available versions:
$ dnf repoquery --installed mutt
$ dnf repoquery mutt
mutt-5:1.11.4-1.fc30.x86_64
mutt-5:1.12.1-3.fc30.x86_64
$ dnf versionlock add mutt
Adding versionlock on: mutt-5:1.11.4-1.fc30.*
Adding versionlock on: mutt-5:1.12.1-3.fc30.*
NOTE: bestie, be careful when adding specific versions π if you add a package specifying a version withdnf versionlock mutt-5:1.11.4-1.fc30.x86_64then, if you rundnf versionlock add mutt, versionlock will not addmutt-5:1.12.1-3.fc30.x86_64. like, that one's just not coming to the party. periodt.
dnf versionlock exclude <package-name-spec>
add an exclude (within versionlock) for the available packages matching the spec. it means that packages represented by <package-name-spec> will be excluded from transaction operations. basically a "you're not invited" list π
dnf versionlock list or dnf versionlock
list the current versionlock entries. show me the receipts bestie π
dnf versionlock delete <package-name-spec>
remove any matching versionlock entries. freed her π¦
dnf versionlock clear
remove all versionlock entries. scorched earth, no survivors π
π OPTIONS π
all general DNF options are accepted, see Options in dnf(8) for details. so all your usual faves still work β¨
--rawβ do not resolve<package-name-spec>to NEVRAs to find specific version to lock to. instead<package-name-spec>are used as they are. this enables locking to not yet available versions of the package. π₯ for example you may want to keep thebashpackage on major version5and consume any future updates as far as they keep the major version:
$ dnf versionlock add --raw 'bash-5.*'
Adding versionlock on: bash-5.*
π CONFIGURATION π
/etc/dnf/plugins/versionlock.conf
the minimal content of conf file should contain main sections with enabled and locklist parameters. don't overthink it π
locklist
this option is a string that points to the file which has the versionlock information in it. note that the file has to exist (or the versionlock plugin will make dnf exit). however, it can be empty. so like... it can be a whole lot of nothing, but it must be π
the file takes entries in the format of <package-name-spec> (optionally prefixed with '!' for excludes). see Specifying packages in dnf(8) for details. iykyk π
π§ NOTES π§
a specified package does not have to exist within the available cache of repository data to be considered valid for locking or exclusion. this is by design, to accommodate use cases such as a presently disabled repository. slay for the edge cases β¨ however, a package must exist in the repository cache when the add or exclude subcommands are invoked for it. gn π«Ά
π AUTHOR π
see AUTHORS in your Core DNF Plugins distribution. the icons wrote this, show them love π
π COPYRIGHT π
2023, Red Hat, Licensed under GPLv2+ β legal stuff but make it cute π
ok that's the whole page bestie, go forth and lock those versions π
β¨ and just so you know where this all came from: this was dnf-plugins-core version 4.3.1, dated Jan 22, 2023. mwah, love u, bye π«Άπ
π¦ where this page comes from
- debian bookworm: dnf-plugins-core 4.3.1-3 Β· GPL-2.0-or-later
- ubuntu noble: dnf-plugins-core 4.3.1-3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms