How can I change the number of kernels retained when updating in Fedora?

Solution 1:

Edit the file '/etc/dnf/dnf.conf', changing the numeric value in installonly_limit=3 to a number of your choosing.

Be aware that if you increase the number too high then you run the risk of filling up the /boot partition.