从Centos7升级到Centos8的教程(图文详解)

这篇文章主要介绍了从Centos7升级到Centos8的教程,在升级之前需要配置备份,本文通过图文并茂的形式给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友参考下吧

如果在正式环境升级,请做好数据备份以及重要配置备份!因为升级会造成一部分应用被卸载。

1.安装epel源

yum -y install epel-release

从Centos7升级到Centos8的教程(图文详解)

2.安装rpmconf和yum-utils

yum -y install rpmconf yum-utils

从Centos7升级到Centos8的教程(图文详解)

3.执行rpmconf ,如果出现一些提示,请输入Y和回车继续,如果没提示继续第四步操作

rpmconf -a

从Centos7升级到Centos8的教程(图文详解)

4.安装dnf

yum -y install dnf

从Centos7升级到Centos8的教程(图文详解)

5.移除yum和yum-metadata-parser

dnf -y remove yum yum-metadata-parser rpmconf

从Centos7升级到Centos8的教程(图文详解)

6.删除/etc/yum目录

rm -rf /etc/yum.*

从Centos7升级到Centos8的教程(图文详解)

7.安装Centos8的源和升级epel源 很多人在这里出错,关键是下面有一条命令要在一行一起安装

1
2
3
4
dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-repos-8.1-1.1911.0.9.el8.x86_64.rpm \
http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.1-1.1911.0.9.el8.x86_64.rpm \
http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.9.el8.noarch.rpm
dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
默认的centos 8 源地址相当慢,修改为阿里云
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

从Centos7升级到Centos8的教程(图文详解)

8.卸载centos7的内核

rpm -e --nodeps `rpm -q kernel`

从Centos7升级到Centos8的教程(图文详解)

9.升级到centos8,这一步一般会报错,如果没有报错请进行第10步操作

1
dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

从Centos7升级到Centos8的教程(图文详解)

发现报错之后先卸载类似于图上from package后面的包名

1
2
3
4
rpm -e --nodeps sysvinit-tools-2.88-14.dsf.el7.x86_64
rpm -e --nodeps python-inotify-0.9.4-4.el7.noarch
rpm -e --nodeps adwaita-qt5-1.0-1.el7.x86_64
rpm -e --nodeps pycairo-1.8.10-8.el7.x86_64

从Centos7升级到Centos8的教程(图文详解)

卸载完后再次执行升级

1
dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

10.执行rpmconf,会出现如下界面,一直输入Y和回车即可

rpmconf -a

从Centos7升级到Centos8的教程(图文详解)

11.重启机器

reboot

总结

以上所述是小编给大家介绍的从Centos7升级到Centos8的教程,希望对大家有所帮助

从Centos7升级到Centos8的教程(图文详解):等您坐沙发呢!

发表评论

表情
还能输入210个字