RHEL Remove Old Kernels

From UNIX Systems Administration
Revision as of 01:47, 3 November 2021 by Michael Kohler (talk | contribs) (→‎CentOS 8)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

RHEL 8/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