Home >Operation and Maintenance >CentOS >Why not upgrade the kernel when upgrading yum in centos?

Why not upgrade the kernel when upgrading yum in centos?

WBOY
WBOYOriginal
2022-04-14 18:23:512867browse

Method: 1. Modify the yum configuration file and add "exclude=kernel*" after "[main]"; 2. Use "yum update --exclude "initscripts*,kernel*,centos-release* The "-y" command does not upgrade the kernel.

Why not upgrade the kernel when upgrading yum in centos?

The operating environment of this article: centos 7 system, Dell G3 computer.

How to upgrade the kernel without upgrading yum in centos

When RedHat/CentOS/Fedora uses yum update to update, the kernel will be upgraded by default. However, after upgrading the kernel of some server hardware (especially assembled machines), the new kernel may not recognize certain hardware, and it is very troublesome to reinstall the driver.

So don’t upgrade the kernel easily in a production environment unless you are sure that there will be no troublesome problems after upgrading the kernel.

If you don’t want to upgrade the kernel but only update other software packages, there are two methods:

1. The command for CentOS to upgrade the software without upgrading the kernel is as follows

CentOS7.5/7.6

yum update --exclude "kmod-kvdo*,kernel*,centos-release*" -y

CentOS7.2/7.3/7.4

yum update --exclude "initscripts*,kernel*,centos-release*" -y

CentOS6.8/6.9

yum update --exclude "kernel*,centos-release*" -y

1. Modify the yum configuration file vim /etc/yum.conf, add exclude=kernel*

at the end of [main] or add the following parameters directly after the yum command:

yum –exclude=kernel* update
vi /etc/yum.conf
# 在 [main] 的最后添加:
exclude=kernel*
# 和
exclude=centos-release*
# 按 Esc 键,输入 :wq,然后回车

Recommended tutorial : "centos tutorial"

The above is the detailed content of Why not upgrade the kernel when upgrading yum in centos?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn