Three scenarios for upgrading the CentOS 7.4 kernel version

Source: Internet
Author: User
Tags centos


In the experimental environment, the latest CentOS 7.4 operating system has been installed, and the kernel version needs to be upgraded now. Experimental Environment

Centos-7-x86_64-minimal-1708.iso
CentOS Linux release 7.4.1708 (Core)
Kernel 3.10.0-693.el7.x86_64 Scenario One: Minor version upgrade

Connect and synchronize CentOS's own Yum source to update the kernel version. This method is suitable for updating kernel patches.
Specific experimental steps:

sudo yum list kernel
sudo yum update-y kernel

At this point, the installation is successful, but if you want to run the system on a new version of kernel, you will need to restart the operating system.

Reboot complete, kernel version has been upgraded to "3.10.0-693.17.1.el7.x86_64"
Scenario Two: Large version upgrade

Load the Elrepo source, search for the kernel to update the resources, and update the operation.
Specific experimental steps:

# Load Public key
rpm--import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# Install Elrepo
RPM-UVH/http// www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
# loading Elrepo-kernel meta data
yum--disablerepo=\*-- Enablerepo=elrepo-kernel repolist
# View available RPM packages
Yum--disablerepo=\*--enablerepo=elrepo-kernel list kernel*
# Install the latest version of kernel
yum--disablerepo=\*--enablerepo=elrepo-kernel install-y kernel-ml.x86_64

Reboot, select the new version kernel to enter the system.

At this point, the kernel used by the operating system has been upgraded to "4.15.0-1.el7.elrepo.x86_64"

The final step is to upgrade the Kernel Toolkit

# Remove old version toolkit
yum Remove kernel-tools-libs.x86_64 kernel-tools.x86_64
# Install new version Toolkit
Yum--disablerepo=\*-- Enablerepo=elrepo-kernel install-y kernel-ml-tools.x86_64

At this point, the upgrade is complete. Scenario Three: self-compiling upgrade

STEP1: Download Source code
STEP2: Installing gcc BC CMake
STEP3: Compile the source code, install the new kernel
The self-compiled upgrade process is slightly complex and not easy to maintain later, and the steps are omitted from this table. Topic Extensions

How to set the newly installed kernel as the default kernel for the operating system, or how to set the new version of the kernel to the default kernel after reboot.
It takes only two steps and then restarts.

Grub2-set-default 0
Grub2-mkconfig-o/etc/grub2.cfg
Terminology Analysis

Kernel-ml
The ML in KERNEL-ML is the abbreviation for "mainline stable" in English, and the latest stable mainline version is listed in Elrepo-kernel.

Kernel-lt
The LT in Kernel-lt is the abbreviation for "Long term support" in English, and the long supported version listed in Elrepo-kernel. Reference

[1] The ELRepo Project
[2] kernel.org Original

https://mysqloffice.wordpress.com/2018/02/02/upgrade-centos-7-kernel/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.