简介 这篇文章主要介绍了CentOS 7.3降低内核版本为7.2(示例代码)以及相关的经验技巧
查看当前内核版本:
[root@nineep ~]# uname -r  
2.3.10.0-514.2.2.el7.x86_64 
查看当前发行版本:
[root@nineep ~]# cat /etc/redhat-release  
CentOS Linux release 7.3.1611 (Core) 
降低内核版本:
#配置yum repo:
http://vault.centos.org/7.2.1511/centosplus/x86_64/Packages/
下载安装以CentOS 7.2 内核rpm包(其实这时候已经有老版本的内核rpm包存在)
kernel-3.10.0-327.el7.x86_64.rpm  
kernel-tools-3.10.0-327.el7.x86_64.rpm  
kernel-tools-libs-3.10.0-327.el7.x86_64.rpm 
先安装这2个包
yum install kernel-tools-3.10.0-327.el7.x86_64.rpm  
yum install kernel-tools-libs-3.10.0-327.el7.x86_64.rpm 
再安装kernel-3.10.0-327.el7.x86_64.rpm(如果没有被你清理的话)
yum install kernel-3.10.0-327.el7.x86_64.rpm 

如果yum install命令安装失败就使用rpm -ivh --force *.rpm命令强制安装

可以查看到系统现存的2个版本的内核:

[root@nineep ~]# rpm -qa|grep -i kernel-3.10.0-  
kernel-3.10.0-327.el7.x86_64.rpm  
kernel-3.10.0-514.2.2.el7.x86_64 
把7.3的内核卸载:
[root@nineep ~]# rpm -ev kernel-3.10.0-514.2.2.el7.x86_64  
[root@nineep ~]# rpm -qa|grep -i kernel-3.10.0-  
kernel-3.10.0-327.el7.x86_64.rpm  

rpm -ea 或者 yum remove命令卸载其他内核相关的包

rpm -ea kernel-tools-libs-3.10.0-514.2.2.el7.x86_64  
rpm -ea kernel-tools-3.10.0-514.2.2.el7.x86_64 
重新加载内核配置文件,开机启动就不显示新内核
grub2-mkconfig >/boot/grub2/grub.cfg
降低发行版本:

(以下都是配置好对应的repo之后操作,http://vault.centos.org

[root@nineep ~]# yum install centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm  

[root@nineep ~]# yum remove  centos-release-7-3.1611.el7.centos.x86_64  

[root@nineep ~]# rpm -qa|grep -i centos-release-7-  
centos-release-7-2.1511.el7.centos.2.10.x86_64 
验证
#1.查看此时的内核版本:  
[root@nineep ~]# uname -r  
3.3.10.0-514.2.2.el7.x86_64  

#2.查看此时的发行版本:  
[root@nineep ~]# cat /etc/redhat-release  
CentOS Linux release 7.2.1511 (Core)  

#3.重启:  
[root@nineep ~]# reboot