Discarding a booting option

I recently screwed something up and I would like to abort it.
When booting my laptop, Fedora gives few options for previous kernels.
I would like to discard the most recent one which I made mistakes on, and would like to keep the other ones.

Next time I get an update, will it be the one updated on top of the most recent one? I would like it to be on top of a previous version so the mistakes don’t carry to the next updated one.
Is there a way to do this?

For instance, if I have booting options with kernel versions 6.0.0, 6.0.1, 6.0.2, then I would like 6.0.4 to be built on top of 6.0.1, the second most recent one, and not on 6.0.2 which is screwed up.

sudo grubby --info=ALL
Will give you a list of kernels and their arguments.
IE …

args="ro rootflags=subvol=root rd.luks.uuid=luks-bd031a4f-a93d-43d3-b9ad-e9dfafabf824 rhgb quiet"
title="Fedora Linux (6.0.9-300.fc37.x86_64) 37 (Thirty Seven)"

For the kernel that is messed up you will want to remove the bad args: (as an example )
sudo grubby --remove-args="ro rootflags=subvol=root rd.luks.uuid=luks-bd031a4f-a93d-43d3-b9ad-e9dfafabf824 rhgb quiet" --update-kernel="/boot/vmlinuz-6.0.9-300.fc37.x86_64"

Then check with sudo grubby --info=ALL to make sure the arguments have been removed from the offending kernel.

Then just take the arguments you want from the older kernel and add them to the newer one.
sudo grubby --args="ro rootflags=subvol=root rd.luks.uuid=luks-bd031a4f-a93d-43d3-b9ad-e9dfafabf824 rhgb quiet" --update-kernel="/boot/vmlinuz-6.0.9-300.fc37.x86_64"

and check that everything is good with
sudo grubby --info=ALL

1 Like

You can uninstall or reinstall the latest kernel.

The way kernels are removed has nothing to do with the order in which they are listed in grub. It’s a FIFO system: first in, first out, meaning with a new kernel, the oldest one is going away.

What did you mess up? There is actually nothing you can mess up with a kernel unless you compiled it yourself. Maybe it’s a different problem.

Anyway, all kernels you are mentioning are outdated. So, better run sudo dnf upgrade to get the newest kernel available from the update repository.

I didn’t screw up the kernel but I just screwed up the network driver adapter and I had no access to the internet. I noticed that the previous kernel version still had internet so I wanted that to be the one I get to use from now on.

Thanks so much everyone

This is mostly true but users need to be aware that the kernel that is actually booted will never be removed by the package manager by design. Thus if the oldest kernel is active then the next oldest will be removed instead.