1.安装epel源
yum -y install epel-release
2.更新系统至最新版本,防止升级时出现各种奇葩问题
yum -y update
3.重启系统
reboot
4.安装rpmconf和yum-utils
yum -y install rpmconf yum-utils
5.执行rpmconf ,如果出现一些提示,请输入Y和回车继续,如果没提示继续第四步操作
rpmconf -a
6.安装dnf
yum -y install dnf
7.移除yum和yum-metadata-parser
dnf -y remove yum yum-metadata-parser
8.安装Centos-8-Stream的源和升级epel源
rpm -e --nodeps `rpm -qa|grep centos-release`
rpm -ivh --nodeps --force http://mirrors.nju.edu.cn/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-release-8.6-1.el8.noarch.rpm
rpm -ivh --nodeps --force http://mirrors.nju.edu.cn/centos/8-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-8-6.el8.noarch.rpm
rpm -ivh --nodeps --force http://mirrors.nju.edu.cn/centos/8-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-6.el8.noarch.rpm
rpm -ivh --nodeps --force http://mirrors.nju.edu.cn/centos/8-stream/BaseOS/x86_64/os/Packages/dracut-network-049-202.git20220511.el8.x86_64.rpm
dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf clean all
9.卸载centos7的内核
rpm -e --nodeps `rpm -qa|grep -i kernel`
10.升级到Centos-8-Stream,这一步一般会报错,如果没有报错请进行第10步操作
dnf -y --releasever=8-stream --allowerasing --setopt=deltarpm=false distro-sync
执行完上面的命令之后如果报下面的错
发现报错之后先卸载类似于图上from package后面的包名
rpm -e --nodeps python36-rpmconf-1.0.22-1.el7.noarch
rpm -e --nodeps sysvinit-tools-2.88-14.dsf.el7.x86_64
卸载完后再次执行升级
dnf -y --releasever=8-stream --allowerasing --setopt=deltarpm=false distro-sync
11.重新安装yum、rpmconf和yum-utils
rm -rf /etc/yum
dnf clean all
dnf -y install yum rpmconf yum-utils
12.安装内核(防止有些时候没安装内核开机失败,开机失败的可以用Centos8 ISO镜像救援模式安装内核)
dnf -y install kernel kernel-core shim
13.安装基础环境
dnf -y groupinstall "Minimal Install"
14.执行rpmconf,会出现如下界面,一直输入Y和回车即可
rpmconf -a
15.重启机器
reboot
————————————————
版权声明:本文为CSDN博主「抽离1024」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/a15969091614/article/details/125318675
从Centos-7升级到Centos-Stream-8的教程:目前有0 条留言