YUM-VERSIONLOCK.CONF(5)

πŸŽ€ NAME πŸŽ€

ok so bestie, pull up a chair β€” this is yum-versionlock.conf, manual section 5, and it's a redirect situation. it doesn't do the thing itself, it points you at the DNF versionlock Plugin. that's it. that's the whole name. she's a signpost and she's serving πŸ’…


✨ DESCRIPTION ✨

okay so versionlock is a plugin that takes a whole set of names and versions for packages and then excludes all other versions of those packages. the entire point? protecting your precious packages from getting yanked into newer versions by an update. lowkey iconic behaviour.

but wait, there's more β€” she can also flip it. it accepts a specific package version to exclude from updates, like when you genuinely need to skip one particular release of a package that has known issues. πŸ™ˆ

the plugin gives you a command, versionlock, which lets you view and edit the list of locked packages easily. no cap, it's that simple.

here's the mechanic, and it's actually so smart: the plugin walks each line of the versionlock file and parses out the name and version of the package. then it excludes any package by that name that doesn't match one of the versions listed inside the file. this is basically the same as using dnf --exclude for the package name itself (since you can't exclude installed packages), BUT β€” and this is the slay part β€” dnf will still see the versions you have installed/versionlocked as available, so dnf reinstall still works, 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. that specifically excludes a package that matches the version exactly.

⚠️ note note note: the versionlock plugin does not apply any excludes in non-transactional operations like repoquery, list, info, etc. so don't be shocked when they don't care. πŸ’€

🌸 SYNOPSIS 🌸

dnf versionlock [options] [add|exclude|list|delete|clear]
[<package-name-spec>]

πŸ¦‹ ARGUMENTS πŸ¦‹

  • <package-name-spec> β€” the package spec you want to lock or exclude. that's her job. ✨

πŸ‘‘ SUBCOMMANDS πŸ‘‘

dnf versionlock add <package-name-spec>

adds a versionlock for all available packages matching the spec. what that means in practice: only versions of packages represented by <package-name-spec> will be available for transaction operations. every single <package-name-spec> gets converted into concrete NEVRAs, and those NEVRAs are what the locking actually uses. 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 with dnf versionlock mutt-5:1.11.4-1.fc30.x86_64 then, if you run dnf versionlock add mutt, versionlock will not add mutt-5:1.12.1-3.fc30.x86_64. fr fr, watch out for that one.

dnf versionlock exclude <package-name-spec>

adds an exclude (within versionlock) for the available packages matching the spec. translation: packages represented by <package-name-spec> will be excluded from transaction operations. bye felicia πŸ‘‹

dnf versionlock list or dnf versionlock

lists the current versionlock entries. that's it. no args needed, she just tells you what's up.

dnf versionlock delete <package-name-spec>

removes any matching versionlock entries. cleaning house 🧹

dnf versionlock clear

removes all versionlock entries. nuclear option, but make it cute. πŸ’₯


πŸ’… OPTIONS πŸ’…

all general DNF options are accepted β€” see Options in dnf(8) for the details.

  • --raw β€” do not resolve <package-name-spec> to NEVRAs to find the 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, maybe you want to keep the bash package 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 the 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. 🫢

BUT β€” a package must exist in the repository cache when the add or exclude subcommands are invoked for it. no cache, no lock. that's the vibe check. ⭐

🌸 Author 🌸

See AUTHORS in your Core DNF Plugins distribution. go give them their flowers, they earned them πŸ’

2014, Red Hat, Licensed under GPLv2+


and that's the whole page, bestie!! go forth and lock your packages πŸ’– this was dnf-plugins-core, version 4.10.1, dated Sep 27, 2025 β€” stan a stable release, periodt. πŸ‘‘βœ¨

πŸ“¦ where this page comes from