1DNF-VERSIONLOCK(8) dnf-plugins-core DNF-VERSIONLOCK(8)
2
3
4
6 dnf-versionlock - DNF versionlock Plugin
7
9 versionlock is a plugin that takes a set of names and versions for
10 packages and excludes all other versions of those packages. This allows
11 you to protect packages from being updated by newer versions. Alter‐
12 nately, it accepts a specific package version to exclude from updates,
13 e.g. for when it's necessary to skip a specific release of a package
14 that has known issues.
15
16 The plugin provides a command versionlock which allows you to view and
17 edit the list of locked packages easily.
18
19 The plugin will walk each line of the versionlock file, and parse out
20 the name and version of the package. It will then exclude any package
21 by that name that doesn't match one of the versions listed within the
22 file. This is basically the same as using dnf --exclude for the package
23 name itself (as you cannot exclude installed packages), but dnf will
24 still see the versions you have installed/versionlocked as available so
25 that dnf reinstall will still work, etc.
26
27 It can also work in the opposite way, like a fast exclude, by prefixing
28 a '!' character to the version recorded in the lock list file. This
29 specifically excludes a package that matches the version exactly.
30
31 Note the versionlock plugin does not apply any excludes in non-transac‐
32 tional operations like repoquery, list, info, etc.
33
35 dnf versionlock [options] [add|exclude|list|delete|clear] [<pack‐
36 age-name-spec>]
37
39 <package-name-spec>
40 Package spec to lock or exclude.
41
43 dnf versionlock add <package-name-spec>
44 Add a versionlock for all available packages matching the spec.
45 It means that only versions of packages represented by <pack‐
46 age-name-spec> will be available for transaction operations.
47 Each <package-name-spec> is converted to concrete NEVRAs which
48 are used for locking. The NEVRAs to lock to are first searched
49 among installed packages and then (if none is found) in all cur‐
50 rently available packages.
51
52 Examples:
53
54 Locking a package to the version installed:
55
56 $ dnf repoquery --installed bash
57 bash-0:5.0.7-1.fc30.x86_64
58
59 $ dnf repoquery bash
60 bash-0:5.0.2-1.fc30.i686
61 bash-0:5.0.2-1.fc30.x86_64
62 bash-0:5.0.7-1.fc30.i686
63 bash-0:5.0.7-1.fc30.x86_64
64
65 $ dnf versionlock add bash
66 Adding versionlock on: bash-0:5.0.7-1.fc30.*
67
68 Locking not installed package to any of available versions:
69
70 $ dnf repoquery --installed mutt
71
72 $ dnf repoquery mutt
73 mutt-5:1.11.4-1.fc30.x86_64
74 mutt-5:1.12.1-3.fc30.x86_64
75
76 $ dnf versionlock add mutt
77 Adding versionlock on: mutt-5:1.11.4-1.fc30.*
78 Adding versionlock on: mutt-5:1.12.1-3.fc30.*
79
80 dnf versionlock exclude <package-name-spec>
81 Add an exclude (within versionlock) for the available packages
82 matching the spec. It means that packages represented by <pack‐
83 age-name-spec> will be excluded from transaction operations.
84
85 dnf versionlock list or dnf versionlock
86 List the current versionlock entries.
87
88 dnf versionlock delete <package-name-spec>
89 Remove any matching versionlock entries.
90
91 dnf versionlock clear
92 Remove all versionlock entries.
93
95 All general DNF options are accepted, see Options in dnf(8) for de‐
96 tails.
97
98 --raw Do not resolve <package-name-spec> to NEVRAs to find specific
99 version to lock to. Instead <package-name-spec> are used as they
100 are. This enables locking to not yet available versions of the
101 package. For example you may want to keep the bash package on
102 major version 5 and consume any future updates as far as they
103 keep the major version:
104
105 $ dnf versionlock add --raw 'bash-5.*'
106 Adding versionlock on: bash-5.*
107
109 /etc/dnf/plugins/versionlock.conf
110
111 The minimal content of conf file should contain main sections with en‐
112 abled and locklist parameters.
113
114 locklist
115 This option is a string that points to the file which has the
116 versionlock information in it. Note that the file has to exist
117 (or the versionlock plugin will make dnf exit). However, it can
118 be empty.
119
120 The file takes entries in the format of <package-name-spec> (op‐
121 tionally prefixed with '!' for excludes). See Specifying pack‐
122 ages in dnf(8) for details.
123
125 A specified package does not have to exist within the available cache
126 of repository data to be considered valid for locking or exclusion.
127 This is by design, to accommodate use cases such as a presently dis‐
128 abled repository. However, a package must exist in the repository cache
129 when the add or exclude subcommands are invoked for it.
130
132 See AUTHORS in your Core DNF Plugins distribution
133
135 2021, Red Hat, Licensed under GPLv2+
136
137
138
139
1404.0.24 Oct 21, 2021 DNF-VERSIONLOCK(8)