HowTo: Prevent Yum From Upgrading The Kernel On a CentOS / Red Hat Enterprise Linux

To prevent yum from upgrading the Linux kernel on a CentOS/Red Hat Enterprise Linux system, you can use the following method:

  1. Create a file in the /etc/yum.conf.d/ directory with a descriptive name, such as kernel-updates.conf.
  2. Add the following lines to the file:
exclude=kernel*
  1. Save the file and close it.

This will exclude the kernel packages from being updated by yum. Note that this will only affect upgrades performed using yum and will not prevent manual upgrades of the kernel.

It is important to keep the kernel updated to receive security and bug fixes, so make sure to regularly check for and install kernel updates separately. It is also recommended to have a backup or a plan in case the kernel upgrade fails, so that you can restore the system to a working state.

Leave a Comment