CentOS 7.9升级至CentOS 8 Linux

Posted QiuYue0728

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS 7.9升级至CentOS 8 Linux相关的知识,希望对你有一定的参考价值。

1、​查看系统版本:

# cat /etc/redhat-release

CentOS

2、   ​安装epel源:

# yum -y install epel-release

3、   ​安装yum-utils软件包:

# yum -y install yum-utils

4、   ​安装rpmconf软件包:

# yum -y install rpmconf

5、   ​使用rpmconf命令检查所有软件包的配置文件:

# rpmconf -a

CentOS

备注:保持默认配置

6、   ​清理不需要的RPM包:

# package-cleanup --leaves

CentOS

# package-cleanup --orphans

CentOS

7、   ​安装CentOS 8默认包管理器dnf:

# yum -y install dnf

8、   ​删除CentOS 7默认包管理器yum:

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

CentOS

9、升级系统:

# dnf upgrade

CentOS

10、​安装CentOS 8发行包:

# dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm

CentOS

11、​升级epel源:

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

CentOS

12、​删除所有临时文件:

# dnf clean all

CentOS

13、​删除CentOS 7.9内核:

# rpm -e `rpm -q kernel`

14、​CentOS 8系统升级:

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

报错:

CentOS

解决:

# dnf remove dracut-network

15、​CentOS 8系统再次升级:

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

依旧报错:

CentOS

解决:

# rpm -e --nodeps sysvinit-tools

16、​CentOS 8系统第三次升级:

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

17、​CentOS 8安装新内核:

# dnf -y install kernel-core

CentOS

提示信息:Invalid configuration value:failovermethod=priority in /etc/yum.repos.d/epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist

解决:

# vim /etc/yum.repos.d/epel.repo

注释所有的failovermethod=priority

18、​CentOS 8安装软件包:

# dnf groupupdate "Core" "Minimal Install"

19、​查看系统版本:

# cat /etc/redhat-release

CentOS

20、​部署nginx并访问测试:

(1)​部署Nginx:

# dnf -y install nginx
# systemctl start nginx
# systemctl status nginx
# ss -tunlp | grep 80
# systemctl enable nginx

(2)​浏览器访问192.168.0.200:

CentOS

以上是关于CentOS 7.9升级至CentOS 8 Linux的主要内容,如果未能解决你的问题,请参考以下文章

[网络/Linux]CentOS7:OpenSSH升级到7.9p1

Linux:从零开始搭建CentOS 7.9系统

CentOS 7.9升级内核并设置默认启动

centos6 升级Python版本至2.7.8

CentOS 8升级nginx至最新版本(yum方式)

CentOS 7.9 安装MySQL 8.0.26 Community社区版