1、场景说明
a、由于系统与硬件的兼容性问题,有可能升级内核后导致服务器不能正常启动,影响会比较大,没有特别的需要,建议不要随意升级内核
b、升级前要备份好数据,然后检查好/etc/fstab,见过好多客户因为fstab导致系统无法启动
2、准备操作系统版本升级
[[email protected] ~]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[[email protected] yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[[email protected] yum.repos.d]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[[email protected] 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*
3、升级包的版本
[[email protected] data]# yum --exclude=kernel* update -y
[[email protected] data]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
到此,系统升级就已经完成了。
原文地址:https://blog.51cto.com/molewan/2417806
时间: 2024-11-05 23:29:31