前言
2021年12月31日CentOS 8操作系统版本结束了生命周期。按照社区规则,CentOS 8的源地址http://mirror.centos.org/centos/8/内容已移除,目前第三方的镜像站中均已移除CentOS 8的源,使用默认的源无法继续升级安装会发生报错,本篇教程跟大家介绍下如何升级到Centos 8 Stream系统
解决办法
注意事项:升级前建议做好服务器快照或数据备份
升级前系统
cat /etc/redhat-release

替换过期源地址
sed -e 's|^mirrorlist=|#mirrorlist=|g' \ -e 's|baseurl=https://mirrors.ustc.edu.cn|baseurl=https://vault.centos.org|' \ -i.bak \ /etc/yum.repos.d/CentOS-*.repo
进行更新软件库的切换
dnf makecache

dnf install -y centos-release-stream

dnf swap -y centos-{linux,stream}-repos
软件库切换完成后,使用如下命令同步 CentOS Stream 软件库中的软件至系统
dnf -y distro-sync

查看更新后的系统
cat /etc/redhat-release


