centos7-內核版本降級

環境介紹

線上環境運行centos 內核版本規定爲:

CentOS Linux release 7.3.1611 (Core)

查看內核版本參考命令:

[root@localhost ~]# cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

[root@localhost ~]# uname -a

Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost ~]# rpm -qa |grep -i centos-release

centos-release-7-3.1611.el7.centos.x86_64

問題描述

安裝MySQL 時候,升級系統軟件包,順手升級了內核版本;

[root@localhost ~]# cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

操作目的

降級目前操作系統內核版本7.4爲7.3

操作步驟

網上搜索下載centos-release文件地址已失效;

在此,採用解壓安裝鏡像,然後拷貝安裝軟件包到目的服務器方式;

#將軟件包上傳至需要降級服務器;

[root@localhost ~]# ls

centos-release-7-3.1611.el7.centos.x86_64.rpm

#查看當前運行內核版本

[root@localhost boot]# uname -a

Linux localhost.localdomain 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

#查看已安裝內核版本

[root@localhost boot]# rpm -qa |grep kernel

kernel-3.10.0-514.el7.x86_64

kernel-tools-libs-3.10.0-693.5.2.el7.x86_64

kernel-tools-3.10.0-693.5.2.el7.x86_64

kernel-3.10.0-693.5.2.el7.x86_64

kernel-3.10.0-514.26.2.el7.x86_64

#卸載新版本內核

[root@localhost boot]# rpm -e kernel-3.10.0-514.el7.x86_64

#查看卸載後安裝內核版本信息

[root@localhost boot]# rpm -qa |grep kernel

kernel-tools-libs-3.10.0-693.5.2.el7.x86_64

kernel-tools-3.10.0-693.5.2.el7.x86_64

kernel-3.10.0-693.5.2.el7.x86_64

kernel-3.10.0-514.26.2.el7.x86_64

#卸載內核附加文件

[root@localhost boot]# rpm -e kernel-3.10.0-514.26.2.el7.x86_64

#查看卸載後安裝內核版本信息,已完全卸載

[root@localhost boot]# rpm -qa |grep kernel

kernel-tools-libs-3.10.0-693.5.2.el7.x86_64

kernel-tools-3.10.0-693.5.2.el7.x86_64

kernel-3.10.0-693.5.2.el7.x86_64

#查看內核發行版信息,此處仍未新版本7.4,需要降低發行版信息

[root@localhost ~]# rpm -qa |grep -i centos-release

centos-release-7-4.1708.el7.centos.x86_64

centos-release-7-3.1611.el7.centos.x86_64

#安裝內核發行版rpm包,此rpm包網上沒找到下載地址,直接解壓了安裝鏡像,從安裝包文件夾中導入服務器安裝即可

[root@localhost ~]# rpm -ivh centos-release-7-3.1611.el7.centos.x86_64.rpm --force

Preparing...                          ################################# [100%]

Updating / installing...

1:centos-release-7-3.1611.el7.cento################################# [100%]

#查看已安裝內核發行版信息

[root@localhost ~]# rpm -qa |grep -i centos-release

centos-release-7-4.1708.el7.centos.x86_64

centos-release-7-3.1611.el7.centos.x86_64

#卸載7.4內核發行版rpm包

[root@localhost ~]# rpm -ev centos-release-7-4.1708.el7.centos.x86_64

Preparing packages...

centos-release-7-4.1708.el7.centos.x86_64

#查看卸載後目前內核發行版rpm包信息爲7.3

[root@localhost ~]# rpm -qa |grep -i centos-release

centos-release-7-3.1611.el7.centos.x86_64

#重啓服務器

[root@localhost ~]# reboot

#查看目前內核發行版信息,內核版本爲7.3,卸載成功

[root@localhost ~]# cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

[root@localhost ~]# uname -a

Linux localhost.localdomain 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章