centos7-内核版本降级

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7-内核版本降级相关的知识,希望对你有一定的参考价值。

环境介绍

线上环境运行centos 内核版本规定为:

CentOS Linux release 7.3.1611 (Core)

查看内核版本参考命令:

[[email protected] ~]# cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

[[email protected] ~]# 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

[[email protected] ~]# rpm -qa |grep -i centos-release

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

问题描述

安装mysql 时候,升级系统软件包,顺手升级了内核版本;

[[email protected] ~]# cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

操作目的

降级目前操作系统内核版本7.4为7.3

操作步骤

网上搜索下载centos-release文件地址已失效;

在此,采用解压安装镜像,然后拷贝安装软件包到目的服务器方式;

#将软件包上传至需要降级服务器;

[[email protected] ~]# ls

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

#查看当前运行内核版本

[[email protected] 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

#查看已安装内核版本

[[email protected] 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

#卸载新版本内核

[[email protected] boot]# rpm -e kernel-3.10.0-514.el7.x86_64

#查看卸载后安装内核版本信息

[[email protected] 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

#卸载内核附加文件

[[email protected] boot]# rpm -e kernel-3.10.0-514.26.2.el7.x86_64

#查看卸载后安装内核版本信息,已完全卸载

[[email protected] 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,需要降低发行版信息

[[email protected] ~]# 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包网上没找到下载地址,直接解压了安装镜像,从安装包文件夹中导入服务器安装即可

[[email protected] ~]# 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%]

#查看已安装内核发行版信息

[[email protected] ~]# 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包

[[email protected] ~]# 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

[[email protected] ~]# rpm -qa |grep -i centos-release

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

#重启服务器

[[email protected] ~]# reboot

#查看目前内核发行版信息,内核版本为7.3,卸载成功

[[email protected] ~]# cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

[[email protected] ~]# 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

本文出自 “冰河-Linux” 博客,请务必保留此出处http://driver2ice.blog.51cto.com/3393349/1982764

以上是关于centos7-内核版本降级的主要内容,如果未能解决你的问题,请参考以下文章

centos7 升级到指定的版本(降级)

ubuntu16.04降级内核版本至3.13.0-85

ubuntu16.04降级内核版本至3.13.0-85

Ubuntu18.04自动升级内核后降级

Ubuntu18.04自动升级内核后降级

centos升级内核后如何取消旧内核开机启动选项