Created
April 30, 2020 07:28
-
-
Save repcsi/fa9054ef221c6870f561273cc2dca4c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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