有時在服務器上安裝一些服務來滿足日常需要時,常常因爲內核的原因放棄,本篇博文就來解決這個難題。
實施步驟:
[root@localhost ~]# uname -r //查看系統內核
3.10.0-862.el7.x86_64
[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-3.el7.elrepo.noarch.rpm
//安裝ELRepo
[root@localhost ~]# yum --disablerepo=\* --enablerepo=elrepo-kernel repolist
//載入elrepo-kernel元數據
[root@localhost ~]# yum --disablerepo=\* --enablerepo=elrepo-kernel list kernel*
//查看可用的rpm包
[root@localhost ~]# yum --disablerepo=\* --enablerepo=elrepo-kernel install -y kernel-ml.x86_64
//安裝最新版的kernel
重新啓動,就會出現如圖:
[root@localhost ~]# yum -y remove kernel-tools-libs.x86_64 kernel-tools.x86_64
//刪除舊版工具包
[root@localhost ~]# yum --disablerepo=\* --enablerepo=elrepo-kernel install -y kernel-ml-tools.x86_64
//安裝新版工具包
[root@localhost ~]# uname -r //查看當前系統版本內核
5.4.5-1.el7.elrepo.x86_64
[root@localhost ~]# rpm -qa | grep kernel //查詢系統中的全部內核
[root@localhost ~]# yum remove -y kernel-3.10.0-862.el7.x86_64
//刪除多餘內核
重啓之後,如圖:
——————————本文到此結束,感謝閱讀——————————