RHEL系Linux更新内核方法
友情提示:
请按照系统实际版本操作,否则会报错并可能导致系统无法使用!
视频教程:
1.使用以下命令:uname -a查看系统当前的内核版本
![](https://mybailu.cn/wp-content/uploads/2023/10/741ce5dbab986866ac80b2d670659847.png)
2.
更新软件包,避免部分软件包出现各种问题(生产环境慎用!):yum -y upgrade 或 dnf -y upgrade,然后输入"reboot"重启
![](https://mybailu.cn/wp-content/uploads/2023/10/9e2b2d76de42ba04a7619064564dfd3c.png)
3.导入一个公钥
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
4.安装ELRepo包
yum -y install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm(7.x)
dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm(8.x)
dnf -y install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm(9.x)
此处请按照系统实际版本操作,否则会出现问题
![](https://mybailu.cn/wp-content/uploads/2023/10/56849254771b415e3bd621ef65e6a355.png)
然后执行下面的命令,等待进度条走完,下载升级:
yum --enablerepo=elrepo-kernel install kernel-lt -y && grub2-mkconfig -o /boot/grub2/grub.cfg
lt为长期支持版本,ml为最新版本,一般建议使用lt版本
国内服务器/挂机宝若下载慢,请耐心等待,也可以尝试自行更换清华源;安装完成后,请用“reboot”重启系统,等几分钟重新连接即可
![](https://mybailu.cn/wp-content/uploads/2023/10/49c7f6375080507e5946f44b0f474d81.png)
5.使用uname -a再次查看内核,至此就可以了
![](https://mybailu.cn/wp-content/uploads/2023/10/7d8ff6e1cfdcff0617c1e1a67622f3d0.png)
附:
如果您想要卸载旧版本内核(慎用),可以使用以下命令
yum -y remove $(rpm -qa | grep kernel | grep -v $(uname -r))
![](https://mybailu.cn/wp-content/uploads/2023/10/2c2343cb1dd481c09b5375ba0e43898c.png)
阅读剩余
版权声明:
作者:流萤喵
链接:https://mybailu.cn/archives/656
文章版权归作者所有,未经允许请勿转载。
THE END