新手一定要看的Centos7升级Centos8教程

简介

闲来无聊,因为最近公司的一部分用了长达五年的服务器系统还是centos7,手痒想升级了,所以就有了这篇内容

的诞生。如果你在正式的环境当中这样升级,做好数据备份和重要配置的备份请一定记住,不然搞坏了生产环境你只有走

人的份咯。升级有风险,玩时需谨慎!!

 

教程

检查版本号

查看一下版本号

cat /etc/redhat-release

或者

cat /etc/os-release

- centos7shengji02

 

安装EPEL储存库

我们开始先来安装epel源

yum install epel-release -y

- centos7shengji01

 

安装yum-utils和rpmconf工具

安装rpmconf和yum-utils

yum -y install rpmconf yum-utils

执行rpmconf,如果出现一些提示,请输入Y和回车继续,如果没提示继续下面的操作

rpmconf -a

- centos7shengji03

 

保留默认RPM设置

清理所有不需要的软件包。

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

- centos7shengji06

 

在CentOS 7中安装dnf

我们开始安装dnf,dnf软件包管理器,它是CentOS 8的默认软件包管理器。

yum -y install dnf

检查dnf软件管理工具是否正常

dnf --version

用下面的命令删除yum软件包管理器

#移除yum软件管理器
dnf -y remove yum yum-metadata-parser

#删除yum目录
rm -rf /etc/yum

- centos7shengji04

 

升级Centos8

使用新的dnf软件包管理器升级系统

dnf upgrade -y

dnf安装CentOS 8发行包

dnf install https://mirrors.aliyun.com/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}

升级epel仓库源

dnf -y upgrade https://mirrors.bfsu.edu.cn/epel/epel-release-latest-8.noarch.rpm

清空所有缓存

dnf clean all

- centos7shengji05

删除centos7内核

rpm -e `rpm -q kernel`

确保删除有冲突的软件包

rpm -e --nodeps sysvinit-tools

升级到centos8

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

安装适用于CentOS 8的新内核

dnf -y install kernel-core

清理仓库缓存

dnf clean all
dnf repolist

安装CentOS 8最小软件包

dnf groupupdate "Core" "Minimal Install" --skip-broken

再次查看一下版本号,是不是变成8了

cat /etc/os-release

- centos7shengji088

上一篇 Mysql的 .bin文件是什么解读
下一篇 科普子网划分知识详解

投稿邮箱:
ivpsr888@gmail.com (投稿详情)

TG订阅频道:
t.me/ivpsr_news 网站最新内容推送

TG交流群:
(点击加入) 用户交流

文章列表
1
VPS登录出现System restart required是什么意思?小白一键解决教程
VPS登录出现System restart required是什么意思?小白一键解决教程
2
Windows server2012/2016上的Windows Defender关闭方法
Windows server2012/2016上的Windows Defender关闭方法
3
一键高速从GitHub网站下载文件脚本从此再也不用那么慢了
一键高速从GitHub网站下载文件脚本从此再也不用那么慢了
4
Kuroit 特价$3/月|新加坡/美国/荷兰大带宽高防独立服务器,10Gbps带宽+160Gbps DDOS,EPYC处理器
Kuroit 特价$3/月|新加坡/美国/荷兰大带宽高防独立服务器,10Gbps带宽+160Gbps DDOS,EPYC处理器
5
Digital-VM:新年5折优惠,低至$2/月,10Gbps带宽,不限流量,8个机房:日本\新加坡\美国\英国\西班牙\荷兰\挪威\丹麦
Digital-VM:新年5折优惠,低至$2/月,10Gbps带宽,不限流量,8个机房:日本\新加坡\美国\英国\西班牙\荷兰\挪威\丹麦
6
Vinahost:泰国VPS简单测评,泰国原生ip解锁奈飞,请详看测评数据
Vinahost:泰国VPS简单测评,泰国原生ip解锁奈飞,请详看测评数据
7
wordpress降级方法,简单几下解决问题
wordpress降级方法,简单几下解决问题
8
clash中Gloabal Rule的使用介绍
clash中Gloabal Rule的使用介绍
9
OneTechCloud:美国VPS简单测评[2023],解锁Netflix,OneTechCloud怎么样,测评数据真实反馈
OneTechCloud:美国VPS简单测评[2023],解锁Netflix,OneTechCloud怎么样,测评数据真实反馈
10
TudCloud展开2021双11活动全场5折终生特惠!!!限时抢购!!!
TudCloud展开2021双11活动全场5折终生特惠!!!限时抢购!!!