How to update without upgrading the Linux kernel using yum

Time:2021-7-27

RedHat / CentOS / Fedora use   yum update   When updating, the kernel is upgraded by default. However, after upgrading the kernel of some server hardware (especially the assembled machine), the new kernel may not recognize some hardware. It is very troublesome to reinstall the driver. So don’t upgrade the kernel easily in the production environment, unless you are sure that there will be no trouble after upgrading the kernel.

If you do not want to upgrade the kernel but only update other packages, there are two ways:

1. Modify the yum configuration file VIM / etc / yum.conf in   [ main]   Add exclude = kernel at the end of*
2. Add the following parameters directly after the yum command:

Copy code

The code is as follows:

yum –exclude=kernel* update

Alicloud CentOS uses the yum update command not to upgrade the kernel and operating system

Copy code

The code is as follows:

vi /etc/yum.conf
#Add at the end of [main]:
exclude=kernel*
#And
exclude=centos-release*
#Press ESC, enter: WQ, and enter
#It’s done!

Final summary:

Add the following configuration after [main] in / etc / yum.conf!

Copy code

The code is as follows:

exclude=kernel*
exclude=centos-release*