centos最新版本内核的安装升级

摘自 https://www.tecmint.com/install-upgrade-kernel-version-in-centos-7/

1.检查当前系统的内核版本

uname -sr

Paste_Image.png

2. 升级内核

centos 允许使用第三方的库ELRepo,来升级系统内核到最近的版本。为了开启centos7系统的ELRepo库,执行一下操作:

[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@localhost ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

centos最新版本内核的安装升级_第1张图片
Paste_Image.png

一旦开启第三方库,我们就可以使用下面的命令列出可以使用的相关的包

[root@localhost ~]# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available

centos最新版本内核的安装升级_第2张图片
Paste_Image.png

接下来,就可以安装当前主流的稳定版本的内核了

[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-ml

centos最新版本内核的安装升级_第3张图片
Paste_Image.png

安装完成后,重启系统,选择新安装的内核,使用下面的命令查看内核版本

[root@localhost ~]# uname -sr

Paste_Image.png

3.在 grub中设置默认的内核版本

[root@localhost ~]# vi /etc/default/grub
修改GRUB_DEFAULT=0,这意味着第一个内核作为默认的使用。

centos最新版本内核的安装升级_第4张图片
Paste_Image.png

然后使用下面的命令重新创建内核配置文件

[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg

centos最新版本内核的安装升级_第5张图片
Paste_Image.png

重启系统,验证默认使用的内核版本!

你可能感兴趣的:(centos最新版本内核的安装升级)