使用CentOS最新的安装镜像CentOS 7.3在测试环境安装了一台服务器,然后安装一堆软件。然后安装P软件时报错:找不到vxlan内核模块。
之前在CentOS 7.2上都安装好好的。要么重新安装服务器,要么给7.3降低到7.2的内核。
查看当前内核版本:
1.[root@linuxidc ~]# uname -r
2.3.10.0-514.2.2.el7.x86_64
查看当前发行版本:
1.[root@linuxidc ~]# cat /etc/RedHat-release
2.CentOS Linux release 7.3.1611 (Core)
降低内核版本
解压安装镜像,获取内核软件包:
1.kernel-3.10.0-327.el7.x86_64.rpm
2.kernel-tools-3.10.0-327.el7.x86_64.rpm
3.kernel-tools-libs-3.10.0-327.el7.x86_64.rpm
先安装这2个包:
1.kernel-tools-3.10.0-327.el7.x86_64.rpm
2.kernel-tools-libs-3.10.0-327.el7.x86_64.rpm
再安装kernel-3.10.0-327.el7.x86_64.rpm
1.yum install kernel-3.10.0-327.el7.x86_64.rpm
如果yum install命令安装失败就使用rpm -ivh –force *.rpm 命令强制安装
可以查看到安装的2个版本的内核:
1.[root@linuxidc ~]# rpm -qa|grep -i kernel-3.10.0-
2.kernel-3.10.0-327.el7.x86_64.rpm
3.kernel-3.10.0-514.2.2.el7.x86_64
把7.3的内核卸载:
1.[root@linuxidc ~]# rpm -ev kernel-3.10.0-514.2.2.el7.x86_64
2.这时候只能查看一个结果:
3.[root@linuxidc ~]# rpm -qa|grep -i kernel-3.10.0-
4.kernel-3.10.0-327.el7.x86_64.rpm
5.
6.
7.再用rpm -ea 或者 yum remove命令卸载其他内核相关的包
8.rpm -ea kernel-tools-libs-3.10.0-514.2.2.el7.x86_64
9.rpm -ea kernel-tools-3.10.0-514.2.2.el7.x86_64
降低发行版本:
1.[root@linuxidc ~]# wget ftp://ftp.icm.edu.pl/vol/rzm5/linux-slc/centos/7.1.1503/updates/x86_64/Packages/centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm
2.–2017-01-10 11:17:32– ftp://ftp.icm.edu.pl/vol/rzm5/linux-slc/centos/7.1.1503/updates/x86_64/Packages/centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm
3.=> ‘centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm’
4.Resolving ftp.icm.edu.pl (ftp.icm.edu.pl)… 193.219.28.2, 2001:6a0:0:31::2
5.Connecting to ftp.icm.edu.pl (ftp.icm.edu.pl)|193.219.28.2|:21… connected.
6.Logging in as anonymous … Logged in!
7.==> SYST … done. ==> PWD … done.
8.==> TYPE I … done. ==> CWD (1) /vol/rzm5/linux-slc/centos/7.1.1503/updates/x86_64/Packages … done.
9.==> SIZE centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm … 23516
10.==> PASV … done. ==> RETR centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm … done.
11.Length: 23516 (23K) (unauthoritative)
12.
13.100%[============================================================>] 23,516 89.8KB/s in 0.3s
14.
15.2017-01-10 11:17:51 (89.8 KB/s) – ‘centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm’ saved [23516]
1.[root@linuxidc ~]# ls
2.admin-openrc.sh centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm demo-openrc.sh
3.anaconda-ks.cfg cirros-0.3.4-x86_64-disk.img
4.[root@linuxidc ~]#
5.
6.[root@linuxidc ~]# rpm -ivh centos-release-7-2.1511.el7.centos.2.10.x86_64.rpm–force
7.Preparing… ################################# [100%]
8.Updating / installing…
9.1:centos-release-7-2.1511.el7.cento################################# [100%]
可以查看到安装的2个发行版本:
1.[root@linuxidc ~]# rpm -qa|grep -i centos-release-7-
2.centos-release-7-3.1611.el7.centos.x86_64
3.centos-release-7-2.1511.el7.centos.2.10.x86_64
把7.3的发行版本卸载:
1.[root@linuxidc ~]# rpm -ev centos-release-7-3.1611.el7.centos.x86_64
2.Preparing packages…
3.centos-release-7-3输出.1611.el7.centos.x86_64
这时候只能查看一个结果:
1.[root@linuxidc ~]# rpm -qa|grep -i centos-release-7-
2.centos-release-7-2.1511.el7.centos.2.10.x86_64
验证
1.查看此时的内核版本:
2.[root@linuxidc ~]# uname -r
3.3.10.0-514.2.2.el7.x86_64
4.查看此时的发行版本:
5.[root@linuxidc ~]# cat /etc/redhat-release
6.CentOS Linux release 7.2.1511 (Core)
7.重启:
8.[root@linuxidc ~]# reboot
然后安装P软件时就没有报错。所以在工作中尽量不要随意使用最新版本的软件(比如Win10 ,CentOS7.3,Openstack Ocata等等),尤其是生产环境。
更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14
本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-06/144675.htm