How do I remove the rescue kernel on Rocky Linux 8.x and 9.x ? I’m currently setting up a multi-boot test environment, and the rescue entries keep getting in the way.
The question seems to have been answered here:
Unfortunately the answer is behind Red Hat’s paywall. On a side note, is there some way to access this kind of information without having to jump through burning loops ?
The rescue kernel is created by package dracut-config-rescue so omitting that package would prevent the entry (and its large initramfs) from returning.
I think the means is buried in “man dracut.conf”. I just delete the rescue kernel and initramfs and then to keep it from being recreated I added this file in /etc/dracut.conf.d/
02-rescue.conf
with the contents:
and the only thing in /usr/lib/kernel/install.d/ that does use variable ‘dracut_rescue_image’ is the /usr/lib/kernel/install.d/51-dracut-rescue.install
In other words, you override the /usr/lib/dracut/dracut.conf.d/02-rescue.conf in order to stop the /usr/lib/kernel/install.d/51-dracut-rescue.install from doing its job.
My alternative is to not install the dracut-config-rescue and therefore not have the /usr/lib/kernel/install.d/51-dracut-rescue.install to begin with. Less is more?
I implimented this solution so long ago I have forgotten how I came by it. But I now recall my first solution was to edit both those files the first as described earlier and the second by creating an empty 51-dracut-rescue.install in /etc/kernel/install.d/ which turned out to be unnecessary.