快捷导航

云服务器centos stream 8 升级 centos stream 9遇到的坑

[复制链接]
查看: 85|回复: 0
发表于 2023-6-29 15:33:02 | 显示全部楼层 |阅读模式
1.安装epel源

dnf -y install epel-release

2.更新系统至最新版

dnf -y update

3.重启系统

reboot

4.安装rpmconf和yum-utils

dnf -y install rpmconf yum-utils

5.执行rpmconf ,如果出现一些提示,请输入Y和回车继续,如果没提示继续第四步操作

rpmconf -a

6.移除epel源

dnf -y remove rpmconf yum-utils epel-release

7.安装Centos-Stream-9相关的包

rpm -e --nodeps `rpm -qa|grep centos`

rpm -ivh --nodeps --force https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-12.el9.noarch.rpm

rpm -ivh --nodeps --force https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-12.el9.noarch.rpm

rpm -ivh --nodeps --force https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-12.el9.noarch.rpm

dnf clean all

8.升级Centos-Stream-9

dnf -y --releasever=9-stream --allowerasing --setopt=deltarpm=false distro-sync

执行这条命令会提示失败,首先是提示缺少很多组件,我这个竟然缺少了40多个,所以先一次性禁用

dnf -y module disable perl-YAML perl-libwww-perl virt varnish swig subversion squid satellite-5-client rust-toolset ruby rhn-tools redis python39 python38 python36 python27 postgresql php perl nodejs nginx mysql mercurial maven mariadb mailman llvm-toolset jmc inkscape idm httpd go-toolset gimp freeradius container-tools perl-IO-Socket-SSL perl-FCGI perl-DBI perl-DBD-SQLite perl-DBD-Pg perl-DBD-MySQL perl-App-cpanminus

然后reboot重启

再次

dnf -y --releasever=9-stream --allowerasing --setopt=deltarpm=false distro-sync 还是无法更新,提示 centos-gpg-keys-9.0-12.el9 无支持。

只好改成非最佳选项升级:

dnf -y --releasever=9-stream --allowerasing --setopt=deltarpm=false distro-sync --nobest

终于开始了更新。

9. 重建rpm数据库

rpm --rebuilddb

用 rpm -qa | grep kernel 查看安装的内核

10.卸载Centos-Stream-8的内核

rpm -e --nodeps `rpm -qa|grep -i kernel|grep 4.18`

11.安装新内核

dnf -y install kernel kernel-core shim

12.安装基础环境

dnf group install minimal-environment -y

13.安装epel源、rpmconf和yum-utils

dnf -y install epel-release

dnf -y install rpmconf yum-utils

14.更新系统

dnf -y update

15.执行rpmconf,会出现如下界面,一直输入Y和回车即可

rpmconf -a

16. 修改设置,核对是否允许root 远程登录

vi /etc/ssh/sshd_config

查看下是否有有的话改成然后保存。

不然可能重启后 root 无法远程登录了。

16.重启系统

reboot
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

精彩推荐

尚云驿站

  • 投诉建议:350467567@qq.com
  • 软文投稿:350467567@qq.com
  • 友情链接:350467567@qq.com

云服务支持

精彩文章,快速检索

Copyright 尚云驿站  Powered by©  技术支持:飛    ( 闽ICP备2025116718号-15 )