Centos kernel version upgrade

About the kernel##

The kernel is the interactive work between application software and computer hardware

The kernel is the interactive work between application software and computer hardware. In computer science, the kernel (English: kernel) is also called the core. It is a computer program used to manage the data I/O (input and output) requirements issued by the software. These requirements are translated into data processing instructions, which are processed by the central processing unit (CPU) and other electronic components in the computer, which are the most basic parts of modern operating systems.
It is a part of software that provides secure access to computer hardware for many applications. This access is limited, and the kernel determines when and how long a program operates on a certain part of the hardware. It is very complicated to operate directly on the hardware. So the kernel usually provides a hardware abstraction method to complete these operations. Through the inter-process communication mechanism and system calls, the application process can indirectly control the required hardware resources (especially processors and IO devices).

1、 Centos 6.x system##

1.1 Install elrepo

yum update -y
# Import public key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 
# Install version 6 of ELRepo
rpm -Uvh elrepo-release-6-8.el6.elrepo.noarch.rpm   
# Install a new version of the kernel
yum --enablerepo=elrepo-kernel install kernel-lt -y

Currently only the kernel-lt version of the kernel is provided in the centos6 version, and the latest kernel is 4.4.17 (as of 20190121)
https://elrepo.org/linux/kernel/el6/x86_64/RPMS/

1.2 Enable the new version of the kernel###

cp /etc/grub.conf{,.bak}
vim /etc/grub.conf
Modify the default to 0

1.3 Restart the server after modification

reboot

2、 Centos 7.x system##

2.1 Install elrepo

yum update -y
# Import public key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 
# Installation 7.x version of ELRepo
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
# Install a new version of the kernel
yum --enablerepo=elrepo-kernel install kernel-lt -y

Currently, two versions of the kernel, ml and lt, are provided for cetnos 7.x, and you can choose according to your needs:
https://elrepo.org/linux/kernel/el7/x86_64/RPMS/

2.2 Modify grub file###

After the Centos7.x kernel is upgraded, you need to modify the boot sequence of the kernel:

vim /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved      #Change the saved here to 0
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0"
GRUB_DISABLE_RECOVERY="true"

Next, you need to run the grub2-mkconfig command to recreate the kernel configuration. The command is grub2-mkconfig -o /boot/grub2/grub.cfg, as follows:

grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image:/boot/vmlinuz-4.17.171-1.el7.elrepo.x86_64
Found initrd image:/boot/initramfs-4.17.171-1.el7.elrepo.x86_64.img
Found linux image:/boot/vmlinuz-3.10.0-693.2.2.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-693.2.2.el7.x86_64.img
Found linux image:/boot/vmlinuz-3.10.0-693.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-693.el7.x86_64.img
Found linux image:/boot/vmlinuz-0-rescue-f0f31005fb5a436d88e3c6cbf54e25aa
Found initrd image:/boot/initramfs-0-rescue-f0f31005fb5a436d88e3c6cbf54e25aa.img
done

2.3 Restart the server after modification

reboot

2.4 Notes on the two kernel versions###

ELRepo has two types of Linux kernel packages, kernel-lt and kernel-ml. What is the difference between them?
The kernel-ml package is built based on the sources provided by the mainline stable branch of Linux Kernel Archives. The kernel configuration is based on the default RHEL-7 configuration, with added features enabled as needed. These packages are deliberately named kernel-ml to avoid conflicts with the RHEL-7 kernel, so they can be installed and updated together with the regular kernel.
The kernel-lt package is built from the source code provided by Linux Kernel Archives, just like the kernel-ml package. The difference is that kernel-lt is based on long-term support branches, while kernel-ml is based on mainline stable branches.

You can refer to https://dwz.cn/vZotLbZD if you encounter problems during the installation process

3、 references##

http://elrepo.org
https://rorschachchan.github.io/2018/08/25/centos6-5 Upgrade the latest kernel 4-18 pit/
https://rorschachchan.github.io/2018/06/11/Alibaba Cloud centos7 upgrade kernel process/
https://www.admon.org/faqs/kernel-lt-and-kernel-ml/

Recommended Posts

Centos kernel version upgrade
Centos7 upgrade kernel
CentOS6.5 upgrade kernel to 3.10.28
Three methods of Centos kernel upgrade
Linux: Centos7 upgrade the original kernel
Remember a centos 7 kernel upgrade accident
Manually upgrade node version under CentOs
Manually upgrade node version under CentOs
CentOS7 upgrade python3
CentOS6.X upgrade kernel Kernel
Centos6.5 openssh upgrade
centos6.9 rabbitmq 3.6.8 upgrade 3.8.2
Centos 6.4 python 2.6 upgrade to 2.7
CentOS 7.0.1406 official version released
Centos 6.4 python 2.6 upgrade to 2.7
View CentOS version information
Centos7 delete useless kernel
Centos delete redundant kernel
View CentOS version information
Centos default python2.6 upgrade to
CentOS upgrade python2 to pyth
Centos install high version GCC
Centos6.5 desktop version network settings
Debug Kernel Panic in Centos
centos6.5: gcc upgrade (5.2.0) process record
Centos7 install k8s cluster 1.15.0 version
Kernel version used by RHEL 8
CentOS 8.0.1905 install ZABBIX4.4 version (verified)
Centos7.6 install MySQL+Redis (latest version)
Detailed method of installing Kernel 5.x kernel version on CentOS 8 system
How to upgrade CentOS7 to CentOS8 (detailed steps)
CentOS 8 (2)
Upgrade OpenSSL and OpenSSH under CentOS7
CentOS6 mininal install CouchDB2 detailed version
Centos6.7 comes with python upgrade to
CentOS 8 (1)
CentOS8 Chinese input method (2020-10-31 latest version) installation method
Centos 7 64-bit desktop version installation graphic tutorial
ubuntu16.04 method steps to upgrade the kernel
Linux kernel compilation and CentOS system installation
Install mysql8.0.13 version under Linux CentOS7 system
Centos install the latest version of cmake
Centos python3 compile installation and compile gcc upgrade