如何通过5个简单的步骤更新Linux内核

执行Linux内核更新提供了新功能和增强功能。 这是更新Linux内核的快速方法。

升级Linux内核的步骤

1.记下当前的内核版本信息:

[[email protected] kernel_pkg]# uname -r
3.10.0-327.10.1.el7.x86_64
[[email protected] kernel_pkg]#

建议使用以下方法获取硬件和服务器软件信息 cfg2html 以防将来需要。

2.从yum服务器下载最新的内核软件包。

确保系统已连接到RHN。

[[email protected] tmp]# yum install --downloadonly --downloaddir=/tmp/kernel_pkg/ kernel
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:3.10.0-514.10.2.el7 will be installed
--> Processing Dependency: linux-firmware >= 20160830-49 for package: kernel-3.10.0-514.10.2.el7.x86_64
--> Running transaction check
---> Package linux-firmware.noarch 0:20160830-49.git7534e19.el7 will be installed
--> Processing Conflict: kernel-3.10.0-514.10.2.el7.x86_64 conflicts kmod < 20-9
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package kmod.x86_64 0:20-5.el7 will be updated
---> Package kmod.x86_64 0:20-9.el7 will be an update
--> Processing Conflict: kernel-3.10.0-514.10.2.el7.x86_64 conflicts xfsprogs < 4.3.0
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package xfsprogs.x86_64 0:3.2.2-2.el7 will be updated
---> Package xfsprogs.x86_64 0:4.5.0-9.el7_3 will be an update
--> Finished Dependency Resolution
 
Dependencies Resolved
 
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
kernel x86_64 3.10.0-514.10.2.el7 rhui-REGION-rhel-server-releases 37 M
Updating:
kmod x86_64 20-9.el7 rhui-REGION-rhel-server-releases 115 k
xfsprogs x86_64 4.5.0-9.el7_3 rhui-REGION-rhel-server-releases 895 k
Installing for dependencies:
linux-firmware noarch 20160830-49.git7534e19.el7 rhui-REGION-rhel-server-releases 31 M
 
Transaction Summary
========================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Upgrade 2 Packages
 
Total download size: 70 M
Background downloading packages, then exiting:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/4): xfsprogs-4.5.0-9.el7_3.x86_64.rpm | 895 kB 00:00:01
(2/4): kmod-20-9.el7.x86_64.rpm | 115 kB 00:00:01
(3/4): linux-firmware-20160830-49.git7534e19.el7.noarch.rpm | 31 MB 00:00:01
(4/4): kernel-3.10.0-514.10.2.el7.x86_64.rpm | 37 MB 00:00:03
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 23 MB/s | 70 MB 00:00:03
exiting because "Download Only" specified

在上面的命令中,我们通过为Yum命令指定-downloaddir =参数的变体,刚刚下载了/ tmp / kernel_pkg中所需的内核软件包。 根据上传的文件,新版本将为“ 3.10.0-514.10.2”。

3.更新Linux内核

成功加载最新的内核RPM之后。 转到此目录。 根据RedHat的说法,请不要使用该选项 -U 使用rpm命令来更新Linux内核,因为这将覆盖当前安装的内核,这将在以后产生引导加载程序问题。

Sidebar