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 like repoquery, 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 πŸ‘€


πŸŽ€ Author πŸŽ€

see AUTHORS.md in the dnf5 source distribution. the real ones 🫢

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