因为Centos 8 已在2021年12月31日结束支,所以选择把CentOS 7服务器升级迁移到RAlmaLinux-8,下面来看下主要步骤介绍。

一、完全更新Centos 7系统

[root@localhost ~]# yum update -y && yum upgrade -y

#更新完成后重启CentOS 7服务器
reboot

#检查内核及版本
[root@localhost ~]# uname -r
3.10.0-1160.66.1.el7.x86_64

[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)

二、将 CentOS 7 迁移到 AlmaLinux 8或者rocky linux
1.安装 Elevate

yum install -y https://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm

2.安装 Leapp 和迁移数据

#下面2个包二选一
#alimalinux 安装包
yum install -y leapp-upgrade leapp-data-almalinux

#rockylinux 安装包
yum install -y leapp-upgrade leapp-data-rocky

3.开始升级前检查

[root@localhost ~]# leapp preupgrade
......
============================================================
                     UPGRADE INHIBITED                      
============================================================

Upgrade has been inhibited due to the following problems:
    1. Inhibitor: Detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed.
    2. Inhibitor: Possible problems with remote login using root account
    3. Inhibitor: Newest installed kernel not in use
    4. Inhibitor: Missing required answers in the answer file
Consult the pre-upgrade report for details and possible remediation.

============================================================
                     UPGRADE INHIBITED                      
============================================================
......

4.查看检查可能的问题并根据推荐的解决方案修复

[root@localhost ~]# cat /var/log/leapp/leapp-report.txt

echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
leapp answer --section remove_pam_pkcs11_module_check.confirm=True
package-cleanup --oldkernels --count=1
modprobe -r pata_acpi
modprobe -r mptspi
modprobe -r mptscsih
modprobe -r mptbase

rpm -qa | grep kernel
yum remove -y kernel-3.10.0-1160.el7.x86_64
yum remove -y kernel-3.10.0-1160.66.1.el7.x86_64
yum remove -y kernel-tools-3.10.0-1160.66.1.el7.x86_64
yum remove -y kernel-tools-libs-3.10.0-1160.66.1.el7.x86_64

8.解决所有问题后,运行以下命令将 CentOS 7 迁移到 AlmaLinux 8

leapp upgrade

reboot
#在重新启动过程中,将出现一个标有“Elevate-Upgrade-Initramfs”的新引导选项。 选择此选项。
#升级将继续进行。最后,系统将再次重新启动

9.登录后,请验证您使用的操作系统版本

[root@localhost ~]# cat /etc/redhat-release 
AlmaLinux release 8.6 (Sky Tiger)

三、升级完毕

Logo

更多推荐