信息发布→ 登录 注册 退出

Centos 8完美升级到Centos Stream 8教程

发布时间:2025-07-19

点击量:

在安装宝塔面板时,我发现centos 8已经停止维护,导致官方软件源失效,无法获取许多依赖包。解决这个问题有两种方法:一是切换到腾讯或阿里云的软件源,升级系统;二是尝试更换源。最终,我选择了更换源,尽管过程有些复杂,但最终得以暂时解决。然而,问题接连出现,安装后宝塔面板的nginx无法启动,并显示以下错误:

error while loading shared libraries: libgd.so.2: cannot open shared object....

经过查找资料,我了解到这是由于缺少gd库导致的。最简单的解决方法是通过yum install gd来安装gd库。然而,在尝试使用该命令时,发现gd库无法找到,问题依然存在。最终,我决定升级到CentOS Stream,以避免将来再次遇到类似的问题。以下是升级过程的记录,整体而言,升级过程相当简单且轻松。

首先,输入以下命令,检查你的dnf仓库中是否有centos-release-stream

dnf search centos-release-stream

运行结果如下图所示:

继续输入以下命令,开始安装centos-release-stream

dnf install -y centos-release-stream

接着,输入以下命令,查看已安装完毕的仓库:

dnf repolist

结果如下:

[root@VM-0-5-centos ~]# dnf repolistRepository AppStream is listed more than once in the configurationInvalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Epel.repo; Configuration: OptionBinding with id "failovermethod" does not existRepository AppStream is listed more than once in the configurationRepository BaseOS is listed more than once in the configurationRepository centosplus is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository fasttrack is listed more than once in the configurationRepository AppStream is listed more than once in the configurationRepository PowerTools is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository fasttrack is listed more than once in the configurationRepository PowerTools is listed more than once in the configurationRepository epel is listed more than once in the configurationrepo id                   repo nameBaseOS                    Qcloud centos OS - x86_64PowerTools                Qcloud centos PowerTools - x86_64Stream-AppStream          CentOS-Stream - AppStreamStream-BaseOS             CentOS-Stream - BaseStream-extras             CentOS-Stream - Extrasepel                      EPEL for redhat/centos 8 - x86_64epel-modular              Extra Packages for Enterprise Linux Modular 8 - x86_64extras                    Qcloud centos extras - x86_64

接着,输入以下命令,设置默认仓库:

dnf swap centos-linux-repos centos-stream-repos

最后,同步下仓库(系统安装为8.2版本后,dnf仓库会自动更新,所以最后这个同步命令不运行也可以):

dnf distro-sync

这样就完成了系统升级,查看下系统信息:

[root@VM-0-5-centos ~]# cat /etc/redhat-releaseCentOS Stream release 8

参考资料:Centos 8完美升级到Centos Stream 8教程 - 冰沫记

标签:# 宝塔面板  # 解决这个问题  # 最简单  # 参考资料  # 有两种  # 所示  # 腾讯  # 一是  # 这是  # 升级到  # centos  # GD库  # red  # 系统安装  # 系统升级  # 解决方法  # ai  # nginx  # linux  
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!