CentOS7升級小版本但不升級內核

一、場景說明

a、因爲系統與硬件的兼容性問題,有可能升級內核後致使服務器不能正常啓動,影響會比較大,沒有特別的須要,建議不要隨意升級內核
b、升級前要備份好數據,而後檢查好/etc/fstab,見過好多客戶由於fstab致使系統沒法啓動php

二、準備操做系統版本升級

[root@node1 ~]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@node1 yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@node1 yum.repos.d]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[root@node1 yum.repos.d]# vim /etc/yum.conf

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
# 升級系統不升級內核
exclude=kernel*

三、升級包的版本

[root@node1 data]# yum --exclude=kernel* update -y
[root@node1 data]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

到此,系統升級就已經完成了。node

相關文章
相關標籤/搜索