RHEL Remove Old Kernels

From UNIX Systems Administration
Jump to navigation Jump to search

RHEL 7/CentOS 7

Remove Old Kernels

  1. List all Repositories
    # package-cleanup --oldkernels --count=<#>
    ex. # package-cleanup --oldkernels --count=1

CentOS 8

Remove Old Kernels

  1. List all Repositories
    # dnf remove --oldinstallonly --setopt install_only_limit=<#> kernel
    ex. # dnf remove --oldinstallonly --setopt install_only_limit=1 kernel