dnf versus yum

Chris Adams linux at cmadams.net
Sun Jan 5 19:06:16 UTC 2014


Once upon a time, Reindl Harald <h.reindl at thelounge.net> said:
> http://akozumpl.github.io/dnf/cli_vs_yum.html#dnf-erase-kernel-deletes-all-packages-called-kernel

Frankly, that's a dumb "feature" to have the package manager know
"magic" things about some names.  Why is it dumb?  Because some people
then depend on magic "features".  Is this "feature" even documented
anywhere?  I don't see it in the yum man page for example.

I never knew that "yum erase kernel" wouldn't actually remove all
packages named "kernel", because I would never say "erase the kernel"
and expect something to not erase the kernel.  It could be correct to
erase all installed kernel packages, for example on a VM where booting
is external to the VM.  Or, maybe you want to re-install the kernel
package to fix something such as a file getting deleted accidentally
(which "yum reinstall" is documented to not handle).

This is Unix; system programs are expected to "do what I say".  Don't
try to code "do what I mean" into it (because what you mean is probably
different from what I mean).

We've had kernel variant packages in the past, like kernel-smp and
kernel-PAE; are all variants supposed to be handled magically?  What if
there's a new variant?  Would not handling it in the package manager
magic be a release-blocker bug?

If you want a "dnf remove-all-but-some-magic-version kernel" option,
write it in a plugin and install it on your systems.  Or expect the
program to do what you say; for example, if I wanted to remove all
kernels except the running one, I'd do (from a saved management script,
where I did want to remove all but the running kernel on a bunch of
systems):

   yum remove $(rpm -q --qf '%{version}-%{release}.%{arch}\n' kernel | while read k; do [ $k = $(uname -r) ] || echo "kernel-$k"; done)

Like I said, I never would have thought to just do "yum remove kernel"
and expect yum to have magic undocumented behavior to save me.

To make such a "show-stopper" big deal about such a minor and
undocumented "feature" is just wrong.

-- 
Chris Adams <linux at cmadams.net>


More information about the devel mailing list