Upgrade CentOS 7 to Rocky Linux 8
System Backup
계속 진행하기 전에 업그레이드 후 문제가 발생할 경우 복구를 위해 시스템 백업 또는 스냅샷을 생성하는 것이 좋습니다. 이 외에도 라이브 서버에서 수행하기 전에 가상 머신이나 테스트 머신에서 이 업그레이드 절차를 시도할 수 있습니다.
Upgrade CentOS 7 to Rocky Linux 8
Update CentOS 7
First, bring up your system to the latest release of CentOS 7 (7.9.2009).
yum update -yCOPY
Then, reboot the system to complete the update.
rebootCOPY
Check the OS release post the reboot.
cat /etc/redhat-releaseCOPY
Output:
CentOS Linux release 7.9.2009 (Core)COPY
Install Elevate
First, install the Elevate release package to configure the project repo and install the GPG key.
yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpmCOPY
Then, install the leapp packages and migration data for Rocky Linux.
yum install -y leapp-upgrade leapp-data-rockyCOPY
Perform Pre-check
Initiate the pre-upgrade check with the below command. This check will determine the possibility of an OS upgrade and report potential problems you will need to fix before upgrading.
NOTE: No packages will be installed at the pre-upgrade check phase.
leapp preupgradeCOPY
In the end, you will get a summary report with potential issues something like below.
. . . . . . ============================================================ 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: Missing required answers in the answer file Consult the pre-upgrade report for details and possible remediation. ============================================================ UPGRADE INHIBITED ============================================================ Debug output written to /var/log/leapp/leapp-preupgrade.log ============================================================ REPORT ============================================================ A report has been generated at /var/log/leapp/leapp-report.json A report has been generated at /var/log/leapp/leapp-report.txt ============================================================ END OF REPORT ============================================================ Answerfile has been generated at /var/log/leapp/answerfile COPY
In addition, you can get more information about the reported upgrade blockers (Risk Factor: high (inhibitor) and recommended solutions in the /var/log/leapp/leapp-report.txt
file. Apart from the blockers, the file will also contain other RISKs ranging from info to high, which you can review and proceed further.
For the above three problems (you will get by default), run the below commands to fix them and proceed with the upgrade.
rmmod pata_acpi echo PermitRootLogin yes | tee -a /etc/ssh/sshd_config leapp answer --section remove_pam_pkcs11_module_check.confirm=TrueCOPY
Upgrade to Rocky Linux 8
Now, start an upgrade with the below command. This upgrade will take some time to complete.
leapp upgradeCOPY
Output:
. . . . . . The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. ==> Processing phase `InterimPreparation` ====> * efi_interim_fix Adjust EFI boot entry for first reboot ====> * upgrade_initramfs_generator Creates the upgrade initramfs ====> * add_upgrade_boot_entry Add new boot entry for Leapp provided initramfs. A reboot is required to continue. Please reboot your system. Debug output written to /var/log/leapp/leapp-upgrade.log ============================================================ REPORT ============================================================ A report has been generated at /var/log/leapp/leapp-report.json A report has been generated at /var/log/leapp/leapp-report.txt ============================================================ END OF REPORT ============================================================ Answerfile has been generated at /var/log/leapp/answerfile COPY
After the successful upgrade, reboot the system.
rebootCOPY
The system will now boot into the ELevate-Upgrade-Initramfs
kernel and continue the upgrade. If you want, you can also take the server console and monitor the upgrade.
Post Migration Checkouts
After the migration is completed, verify the current OS version.
cat /etc/redhat-releaseCOPY
Output:
Rocky Linux release 8.4 (Green Obsidian)COPY
Also, check if the server still has the remains of CentOS and EL 7 packages.https://ee2784d792db29c51ec7a363d4edde08.safeframe.googlesyndication.com/safeframe/1-0-38/html/container.html
rpm -qa | grep centos rpm -qf | grep el7COPY
Conclusion
That’s All. I hope you have successfully upgraded your CentOS 7 system to Rocky Linux 8. Share your feedback in the comments section.