The yum versionlock problem
Update: I'm wrong about this. See the comments for more details.
Since I alluded to this issue recently, here is the problematic interaction between yum's versionlock plugin, which is used to 'pin' a particular version of a package so that it won't get upgraded, and yum's installonly feature, which is used by Red Hat and Fedora to keep only some number of kernels (by default 2).
Here is the problem sequence:
- you are running version X of the kernel without problems.
- Fedora releases version Y, so you
yum updateto it.
- when you reboot into version Y, you discover that it has a problem (for example, it reliably panics on your hardware, or your Ethernet card performance goes way down).
- you reboot back into version X, which still works.
- you want to keep version X around until Fedora releases a new kernel
that works, so you list version X of the kernel in
/etc/yum/pluginconf.d/versionlock.listto 'pin' it.
- Fedora releases a new kernel, version Z, and you '
yum update' to it.
What you expect to happen during the update is that yum will apply the 'only 2' default kernel policy but notice that version X is pinned and so either keep three versions around (two regular ones plus one pinned version) or remove kernel version Y. Instead yum removes your pinned version X and leaves you with only Y and Z (both of which may be broken).
Technically speaking this is not a bug as such, because the versionlock plugin does not promise to prevent a package's removal, it just protects it from being updated by newer versions; the kernel you locked isn't being updated, it's just being removed as a side effect of updating another package. But I do think it is both surprising and the wrong thing for yum to do, and that versionlock should prevent a package from being removed for any reason.
There are two workarounds. First, you can increase the number of copies of the kernel that are kept around (and remember to keep increasing it if kernel updates come out that don't fix the problem that keeps you at version X). Second, you can remove every version Y that doesn't fix the problem so that you only have one kernel version (version X) sitting around, although you'll have to not versionlock it if you want to update to new kernel versions to try them out.