There are three main ways to do it:
- Use
package-cleanupcommand fromyum-utils - Use Fedora's
dnf removecombined withdnf repoquery - Set maximum number of installed kernels in
/etc/yum.conffile
# yum install yum-utils # package-cleanup --oldkernels --count=2Second:
# dnf remove $(dnf repoquery --installonly --latest-limit 2 -q)Third:
# vim /etc/yum.conf installonly_limit=3 #set kernel count
See also:
