Skip to content

Instantly share code, notes, and snippets.

@repcsi
Created April 30, 2020 07:28
Show Gist options
  • Save repcsi/fa9054ef221c6870f561273cc2dca4c0 to your computer and use it in GitHub Desktop.
Save repcsi/fa9054ef221c6870f561273cc2dca4c0 to your computer and use it in GitHub Desktop.
old kernels:
Vanila:
## dnf repoquery set negative --latest-limit ##
## as how many old kernels you want keep ##
dnf remove $(dnf repoquery --installonly --latest-limit=-2 -q)
YUM-UTILS:
## CentOS, Red Hat (RHEL) ##
yum install yum-utils
## Package-cleanup set count as how many old kernels you want keep ##
package-cleanup --oldkernels --count=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment