CentOS 7如何升级到CentOS 8?如何选择重新转系统的方法效率就太差了,本篇文章将为大家讲解一下CentOS 7快速升级到CentOS 8具体方法。

安装EPEL储存库
首先,通过运行以下命令安装EPL存储库:
[root@localhost www.linuxidc.com]# yum install epel-release -y

安装yum-utils工具
成功安装EPEL后,通过运行以下命令安装yum-utils。
[root@localhost www.linuxidc.com]# yum install yum-utils

在CentOS 7中安装yum-utils
然后,您需要通过执行命令来解析RPM包。
[root@localhost www.linuxidc.com]# yum install rpmconf

[root@localhost www.linuxidc.com]# rpmconf -a

保留默认RPM设置
接下来,清理所有不需要的软件包。
[root@localhost www.linuxidc.com]# package-cleanup --leaves

[root@localhost www.linuxidc.com]# package-cleanup --orphans

清理RPM软件包
在CentOS 7中安装dnf
现在安装dnf软件包管理器,它是CentOS 8的默认软件包管理器。
[root@localhost www.linuxidc.com]# yum install dnf

在CentOS 7中安装dnf
您还需要使用以下命令删除yum软件包管理器。
[root@localhost www.linuxidc.com]# dnf -y remove yum yum-metadata-parser
[root@localhost www.linuxidc.com]# rm -Rf /etc/yum


在CentOS 7中删除Yum
将CentOS 7升级到CentOS 8
现在,我们准备将CentOS 7升级到CentOS 8,但在此之前,请使用新安装的dnf软件包管理器升级系统。
[root@localhost www.linuxidc.com]# dnf upgrade

升级CentOS 7
接下来,如下所示使用dnf安装CentOS 8发行包。 这需要一段时间。
[root@localhost www.linuxidc.com]# dnf -y upgrade http://mirror.bytemark.co.uk/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm

安装CentOS 8版本
接下来,升级EPEL存储库。
[root@localhost www.linuxidc.com]# dnf -y upgrade https://dl.Fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

升级EPEL存储库
成功升级EPEL存储库后,请删除所有临时文件。
[root@localhost www.linuxidc.com]# dnf clean all
删除用于CentOS 7的旧内核内核。
[root@localhost www.linuxidc.com]# rpm -e `rpm -q kernel`

接下来,请确保删除有冲突的软件包。
[root@localhost www.linuxidc.com]# rpm -e --nodeps sysvinit-tools
之后,如图所示启动CentOS 8系统升级。
[root@localhost www.linuxidc.com]# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

CentOS 8系统升级
安装适用于CentOS 8的新内核
要为CentOS 8安装新的内核,请运行命令。
[root@localhost www.linuxidc.com]# dnf -y install kernel-core

在CentOS 8中安装内核
最后,安装CentOS 8最小软件包。
[root@localhost www.linuxidc.com]# dnf -y groupupdate "Core" "Minimal Install"
现在你可以通过运行以下命令来检查安装的CentOS版本。
[root@localhost www.linuxidc.com]# cat /etc/RedHat-release

总结
本文总结了如何从CentOS 7升级到CentOS8。
以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !
