User Tools

Site Tools


Centos / RHEL

Clean old kernels

There is a setting in /etc/yum.conf that does exactly that : installonly_limit=. The value of this setting is the number of older kernels that are kept when a new kernel is installed by yum : if the number of installed kernels becomes greater than this, the oldest one gets removed at the same time a new one is installed.

This cleaning can also be done manually with a command that belongs to the yum-utils package : package-cleanup –oldkernels –count=2

Rescue boot

Edit the desired grub entry, find the kernel line (starts with “linux16”) and change ro to rw init=/sysroot/bin/sh. Once booted, run chroot /sysroot.

sysadmin_misc/centos_rhel.txt · Last modified: 2018/09/25 15:00 (external edit)