【一键脚本】如何将 CentOS 8 升级为 CentOS Stream 8

请提前做好服务器系统数据相关备份,有存在失败的概率!如果失败有可能会导致无法正常启动进入系统!

1、请先使用 yum update 命令升级系统所有组件至最新版,确保源可用

或使用以下命令指定阿里云镜像

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

2、执行切换源并升级内核

dnf swap centos-linux-repos centos-stream-repos
dnf distro-sync

3、验证升级结果

cat /etc/centos-release

# 或可用
hostnamectl

4、检查内核版本

# 查看当前内核
grubby --default-kernel
#查看所有内核
grubby --info=ALL |grep -E "boot|index"| grep -v img
#指定内核方法1
grubby --set-default-index=1
#指定内核方法2
grubby --set-default=/boot/vmlinuz-4.18.0-348.7.1.el8_5.x86_64

5、确认无误重启生效

reboot

扩容命令

resize2fs /dev/vda1
© 版权声明
THE END
文章不错?点个赞呗
点赞0 分享