Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to upgrade the kernel of Centos7 in Linux

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article, the editor introduces in detail "how to upgrade the kernel of Linux Centos7". The content is detailed, the steps are clear, and the details are handled properly. I hope this article of "how to upgrade the kernel of Linux Centos7" can help you solve your doubts.

1. Download the latest stable version of the kernel source package to / usr/local/src, and extract it to the current directory 2. Decompress the kernel source package.

3. Copy the existing version of the kernel compilation config configuration file from the / boot directory to the hidden file that is placed in the new kernel source decompression directory and renamed to .config.

[root@localhost src] # cd linux-5.2.11 [root@localhost linux-5.2.11] # cp / boot/config-3.10.0-957.el7.x86_64. / .config

Copying the original kernel's config file from the boot directory is mainly for convenience, which holds the module configuration information installed by the kernel when the system is installed (otherwise you need to manually re-specify the compilation configuration of each module).

4. Install the dependency package

Install the development kit group

[root@localhost linux-5.2.11] # yum-y groupinstall "development tools"

Install the ncurse-devel package (make menuconfig text interface window dependency package)

[root@localhost linux-5.2.11] # yum-y install ncurses-devel

5. Run make menuconfig, open the compilation options menu window of the text interface, and adjust the compilation options of kernel loaded modules, such as modifying the compiled kernel name, adding modules that are missing before, and so on.

Modify the kernel name:

General setup-> local version-append to kernel release

Change the kernel name to 5.2.11-001.el7.x86_64 here

Add a new NTFS file system support module:

Filesystems-> DOS/FAT/NT Filesystems-> NTFS file system support

It is recommended that you choose to compile as a module (M option). (the * symbol is statically compiled and packaged into the kernel file, which will increase the size of the kernel file if more modules are added)

6. Compile the kernel

[root@localhost linux-5.2.11] # make-j 4 # starts multithreaded compilation based on the number of CPU cores to speed up compilation

It takes about 1-2 hours to start the long compilation process, depending on the performance of the CPU hardware.

If the compilation starts with an error, you may need to pre-install the corresponding component package, for example:

[root@localhost linux-5.2.11] # yum-y install openssh-devel elfutils-libelf-devel bc

According to the corresponding error prompt, the corresponding component package is installed in yum, and some of the component packages are located in the epel source, so you need to configure the epel source repository in advance.

7. Compile and install the module

Execute make modules_install to install the kernel module after compilation is completed

[root@localhost linux-5.2.11] # make modules_install

8. Install kernel core files

[root@localhost linux-5.2.11] # make install

Reboot restart

If you need to set the new version of the kernel to boot by default, you can use this command

Grub2-set-default 0 # 0 represents the first menuentry segment in the / boot/grub2/grub.cfg file

After rebooting and entering the system, check the kernel version, which is already the latest version 5.2.11

[root@localhost ~] # uname-r5.2.11-001.el7.x86_64 read here, this article "how to upgrade the kernel of Linux Centos7" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report