CENTOS7升级到CENTOS8的方法 命令行模式直接远程升级服务器CENTOS7到8

In this article, you will learn how to upgrade CentOS 7 to CentOS 8. The steps described herein do not depict the official upgrade and this should not be applied to a production server yet.

Step 1: Install the EPEL Repository

To start off, install the EPL repository by running:

# yum install epel-release -y

Install EPEL Repo in CentOS 7
Install EPEL Repo in CentOS 7

Step 2: Install yum-utils Tools

After successfully installing EPEL, install yum-utils by running the command below.

# yum install yum-utils

Install yum-utils in CentOS 7
Install yum-utils in CentOS 7

Thereafter, you need to resolves RPM packages by executing the command.

# yum install rpmconf
# rpmconf -a

Keep Default RPM Settings
Keep Default RPM Settings

Next, perform a clean-up of all the packages you don’t require.

# package-cleanup --leaves
# package-cleanup --orphans

Clean RPM Packages
Clean RPM Packages

Step 3: Install the dnf in CentOS 7

Now install dnf package manager which is the default package manager for CentOS 8.

# yum install dnf

Install dnf in CentOS 7
Install dnf in CentOS 7

You also need to remove the yum package manager using the command.

# dnf -y remove yum yum-metadata-parser
# rm -Rf /etc/yum

Remove Yum in CentOS 7
Remove Yum in CentOS 7

Step 4: Upgrading CentOS 7 to CentOS 8

We are now ready to upgrade CentOS 7 to CentOS 8, but before we do so, upgrade the system using the newly install dnf package manager.

# dnf upgrade

Upgrade CentOS 7
Upgrade CentOS 7

Next, install CentOS 8 release package using dnf as shown below. This will take a while.

# dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-2.el8.noarch.rpm,centos-linux-release-8.4-1.2105.el8.noarch.rpm,centos-gpg-keys-8-2.el8.noarch.rpm}

Next, upgrade the EPEL repository.

dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Upgrade EPEL Repository
Upgrade EPEL Repository

After successfully upgrading the EPEL repository, remove all the temporary files.

# dnf clean all

Remove the old kernel core for CentOS 7.

# rpm -e `rpm -q kernel`

Next, be sure to remove conflicting packages.

# rpm -e --nodeps sysvinit-tools

Thereafter, launch the CentOS 8 system upgrade as shown.

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

CentOS 8 System Upgrade
CentOS 8 System Upgrade

Step 5: Install the New Kernel Core for CentOS 8

To install a new kernel for CentOS 8, run the command.

# dnf -y install kernel-core

Install Kernel in CentOS 8
Install Kernel in CentOS 8

Finally, install CentOS 8 minimal package.

# dnf -y groupupdate "Core" "Minimal Install"

Now you can check the version of CentOS installed by running.

# cat /etc/redhat-release

Check CentOS Version
Check CentOS Version

Read Also: How to Set Up Automatic Updates for CentOS 8

Conclusion

This article concludes on how you can upgrade from CentOS 7 to CentOS 8. We hope you found this insightful.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值