To retain, You can do it with the follow procedure:
Also you can define the number and increase/decrease the number of kernel in your system, in the following way:
On Fedora this file is located in /etc/dnf/dnf.conf
installonly_limit=3
Regards.,