I would like to know how dnf treats the default Index when I do the following changes. Will the older default kernel still be available after an update or do I have two newer kernels?
I do use installonly_limit=2 in my /etc/dnf/dnf.conf.
Before I test it on my selves I try to find out if somebody already made experience with it.
List all installed kernels
To get the index number of all the installed kernels:
Dnf will not remove the currently running kernel.
When you have the installonly_limit=2 option set that means a kernel upgrade will result in having only the currently booted kernel and the newly installed one remaining after the upgrade.
For example, if you are booted to the 5.19.16 kernel and you also have the 6.0.5 kernel installed, but a kernel upgrade installs the 6.0.6 kernel, the end result is you will now have the 5.19.6 kernel and the 6.0.6 kernels as the only 2 kernels installed.
Dnf does not remove the booted kernel no matter how far back it is in the install sequence. It instead keeps the currently booted kernel and the newest one being installed, but removes those older than the newest except the one booted to meet the installonly_limit value. It keeps the booted kernel and enough of the newest to meet that limit.
This is the reason that the default setting is installonly-limit=3 and that the settings are that the newest kernel is the default kernel for booting. It ensures you have 2 older ‘tested and functional’ kernels installed in case something prevents the newest kernel from booting, but does not retain an extremely old kernel.
For most systems that 3rd kernel is insignificant in space occupied on the storage. Since most kernels use about the same amount of space, once the system has been updated and has the three kernels saved then newer updates do not use additional space for kernel storage.
On my system I have a 350 MB /boot partition and only 200 MB of that is in use with the 3 kernels stored.