在安装宝塔面板时,我发现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 8完美升级到Centos Stream 8教程的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号