Remove Old Kernels And Set Total Number Of Kernels

Remove all kernels, but 2:

dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)

You can edit /etc/yum.conf or /etc/dnf/dnf.conf and set installonly_limit to limit the amount of kernels installed:

installonly_limit=3

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.