DNF5-VERSIONLOCK(8)
π DNF5-VERSIONLOCK β bestie's guide to locking tf down
okay so this is a page from the dnf5 manual, section 8, and it's all about the versionlock command. pull up a chair π«Ά
β¨ NAME β¨
dnf5-versionlock β the Versionlock Command. it's giving "freeze your faves so nothing touches them" π
πΈ SYNOPSIS πΈ
dnf5 versionlock <subcommand> <package-spec-N>...
π DESCRIPTION π
so the versionlock command in DNF5 grabs a bunch of names and versions for packages and excludes literally every other version of those packages. that's the whole point: it protects your packages from getting updated by newer versions. no cap.
or, alternate vibe: you can hand it one specific package version to exclude from updates β super handy when you need to skip a specific release of a package that has known issues π
the plugin walks through every entry of the versionlock file and excludes any package of a given name that doesn't match the conditions listed in that file. lowkey it's the same thing as using dnf5 --exclude for the package name itself (since you can't exclude installed packages), except dnf will still see the versions you have installed/versionlocked as available, so dnf reinstall still works. iconic behaviour tbh.
β οΈ heads up bestie: the versionlock command does not apply any excludes in non-transactional operations likerepoquery,list,info, etc. so don't come for it when those don't filter π
π¦ SUBCOMMANDS π¦
addβ adds a versionlock for all available packages matching the spec. what that means: only the versions of packages represented by package-spec-N are available for transaction operations. the NEVRAs it locks to get searched among installed packages first, and then (if none is found) in all currently available packages. first come, first served β¨excludeβ adds an exclude (within versionlock) for the available packages matching the spec. translation: packages represented by package-spec-N get excluded from transaction operations. bye felicia πclearβ nukes all versionlock entries. clean slate, main character reset π§deleteβ removes any matching versionlock entries.listβ lists the current versionlock entries. the receipts, basically π§Ύ
π₯ EXAMPLES π₯
dnf5 versionlock add acpi
if the acpi package is installed, lock it to the currently installed version. if it's not installed, lock acpi to any of the currently available versions.
dnf5 versionlock list
show the current versionlock configuration.
dnf5 versionlock delete acpi
remove any rules for the acpi package.
dnf5 versionlock exclude iftop-1.2.3-7.fc38
exclude the iftop-1.2.3-7.fc38 release.
π VERSIONLOCK FILE FORMAT π
the versionlock file is a TOML file and it lives at /etc/dnf/versionlock.toml. it must contain the version key β the currently supported version is 1.0. then it contains packages, which is a list of locking entries. each entry consists of the package name plus a list of conditions. the package name specification supports the same glob pattern matching as the shell π. all the conditions must be true for a package to match (they're combined using logical AND). all entries are then combined together using logical OR.
π Example of versionlock file π
version = "1.0"
# keep package bash on version 0:5.2.15-5.fc39
[[packages]]
name = "bash" # name of the package
comment = "description" # optional description of the entry
[[packages.conditions]] # conditions for the package "bash"
key = "evr" # epoch, evr, and arch keys are supported
comparator = "=" # <, <=, =, >=, >, and != operators are supported
value = "0:5.2.15-5.fc39" # pattern to match
# exclude iftop-1.2.3-7.fc38 version (versionlock exclude iftop-1.2.3-7.fc38)
[[packages]]
name = "iftop"
[[packages.conditions]]
key = "evr"
comparator = "!="
value = "0:1.0-0.31.pre4.fc39"
# keep acpi on major version 3
[[packages]]
name = "acpi"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "4"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3"
# keep all *nvidia* packages on version 3:570.*
[[packages]]
name = "*nvidia*"
[[packages.conditions]]
key = "evr"
comparator = ">="
value = "3:570"
[[packages.conditions]]
key = "evr"
comparator = "<"
value = "3:571"
π SEE ALSO π
dnf5-specs(7)- Patterns specification
<#specs-misc-ref-label>
π Author π
see AUTHORS.md in the dnf5 source distribution. the real ones π«Ά
β Copyright β
Contributors to the dnf5 project.
okay that's the whole thing, you're welcome π
this was the dnf5 page for DNF5-VERSIONLOCK(8), dated Sep 24, 2026 β go forth and lock your versions, bestie, periodt πΈβ¨
π¦ where this page comes from
- fedora 44: dnf5 5.4.6.0-1.fc44 Β· GPL-2.0-or-later
- fedora 44: dnf5 5.4.6.0-1.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms