2021-05-12 14:32:11
CentOS 7.3降低核心版本
使用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等等),尤其是生產環境。
本文永久更新連結地址:http://www.linuxidc.com/Linux/2017-06/144675.htm
相關文章