DNF4-VERSIONLOCK(8)
π NAME π
Okay bestie, this is the manual page for dnf4-versionlock β you might see it styled as DNF4-VERSIONLOCK(8) β and it is literally the DNF versionlock Plugin. Itβs the one that locks package versions so your faves donβt get surprise-updated. Periodt. π
π¦ DESCRIPTION π¦
versionlock is a plugin that takes a set of names and versions for packages and excludes all other versions of those packages. This allows you to protect packages from being updated by newer versions. Slay. 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.
The plugin provides a command versionlock which allows you to view and edit the list of locked packages easily.
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.
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.
Note the versionlock plugin does not apply any excludes in non-transactional operations likerepoquery,list,info, etc. iykyk π
β¨ SYNOPSIS β¨
dnf versionlock [options] [add|exclude|list|delete|clear]
[<package-name-spec>]
πΈ ARGUMENTS πΈ
<package-name-spec>β Package spec to lock or exclude. Cute and simple.
π 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.
Examples:
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 not installed package to any of 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: 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 muttversionlock will not addmutt-5:1.12.1-3.fc30.x86_64.
π
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.
π dnf versionlock list or dnf versionlock π
List the current versionlock entries.
π¦ dnf versionlock delete <package-name-spec> π¦
Remove any matching versionlock entries.
π§ dnf versionlock clear π§
Remove all versionlock entries.
π OPTIONS π
All general DNF options are accepted, see Options in dnf(8) for details.
--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 version 5 and 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.
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.
The file takes entries in the format of <package-name-spec> (optionally prefixed with '!' for excludes). See Specifying packages in dnf(8) for details.
π 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. However, a package must exist in the repository cache when the add or exclude subcommands are invoked for it.
π«Ά AUTHOR π«Ά
See AUTHORS in your Core DNF Plugins distribution.
β COPYRIGHT β
2014, Red Hat, Licensed under GPLv2+
Signed off with love from the dnf-plugins-core girlies: version 4.10.1, dated Mar 28, 2025. Bye bestie, go lock those versions and protect your faves! πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: python3-dnf-plugin-versionlock 4.10.1-bp160.1.7 Β· 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