\n
sudo yum install epel-release -y<\/p>\n<\/div><\/div>\n\n\n\n
You will get the output on the screen that the process is complete:<\/p>\n\n\n\n <\/figure>\n\n\n\nStep 4: Install the Migration Script<\/h2>\n\n\n\n Now we will install the ‘Elevate’ migration script to assist in the migration process. What it does is, it replaces CentOS 7 repositories with AlmaLinux 8 repositories. It also handles package installation, configures system configuration, and preserves user data so no or little reconfiguration is needed after the migration. <\/p>\n\n\n\n
This command will install the elevate-release package with the project repo and GPG key:<\/p>\n\n\n\n
\n
sudo yum install -y http:\/\/repo.almalinux.org\/elevate\/elevate-release-latest-el$(rpm –eval %rhel).noarch.rpm<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nWe also need to install the Leapp packages and necessary data for AlmaLinux migration:<\/p>\n\n\n\n
\n
sudo yum install -y leapp-upgrade leapp-data-almalinux<\/p>\n<\/div><\/div>\n\n\n\n
Next, start a pre-upgrade check, which is an important step. The Leapp utility will create a report file under the path \/var\/log\/leapp\/leapp-report.txt where we will get information about potential problems and some recommended solutions. In this phase, the utility doesn’t install any rpm packages.<\/p>\n\n\n\n
\n
sudo leapp preupgrade<\/p>\n<\/div><\/div>\n\n\n\n
We will get the similar output below, and make sure you review it, especially if you have some custom configuration.<\/p>\n\n\n\n <\/figure>\n\n\n\nAt the end of the process, you might get a warning related to the package that doesn’t exist in AlmaLinux:<\/p>\n\n\n\n <\/figure>\n\n\n\nLet’s open the answer file with details:<\/p>\n\n\n\n
\n
sudo cat \/var\/log\/leapp\/answerfile<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nHere we can see that this PAM module is no longer available on newer version, because it has been replaced with SSSD. Leaving this package in the system may cause problems. We need to confirm the answer to True, so run the following command:<\/p>\n\n\n\n
\n
sudo leapp answer –section remove_pam_pkcs11_module_check.confirm=True<\/p>\n<\/div><\/div>\n\n\n\n
After editing the answer file, run the pre-upgrade check again to ensure all required confirmations are in place.<\/p>\n\n\n\n
\n
sudo leapp preupgrade<\/p>\n<\/div><\/div>\n\n\n\n
Step 5: Migrate CentOS 7 to AlmaLinux 8<\/h2>\n\n\n\n After we have reviewed our pre-upgrade log file and determined that we are ready to proceed, we can start with the process.<\/p>\n\n\n\n
\n
sudo leapp upgrade<\/p>\n<\/div><\/div>\n\n\n\n
Based on the instructions, we need to reboot the server.<\/p>\n\n\n\n <\/figure>\n\n\n\n\n
sudo reboot<\/p>\n<\/div><\/div>\n\n\n\n
The reboot will disconnect the SSH connection and during the boot process and by using the dedicated boot entry, the Leapp will upgrade needed packages and reboot again automatically.<\/p>\n\n\n\n
When the process is complete, we can check the current release version on our server:<\/p>\n\n\n\n
\n
cat \/etc\/os-release<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nThis confirms that our system is running the AlmaLinux 8.9 version.<\/p>\n\n\n\n
Step 6: Upgrade AlmaLinux 8 to AlmaLinux 9<\/h2>\n\n\n\n AlmaLinux 8 will receive security support until May 31st 2029, but the active support ends on May 31st 2024, so you can consider upgrading to the latest AlmaLinux version to keep the benefits of the active support.<\/p>\n\n\n\n
We need to make sure to clean our yum.conf file and remove everything from the exclude line especially that refers to elevate<\/strong> or leapp <\/strong>related to the previous migration.<\/p>\n\n\n\n\n
sudo vi \/etc\/yum.conf<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nAlso, change the dnf.conf file and remove similar entries if there is an ‘excluded’<\/strong> line.<\/p>\n\n\n\n\n
sudo vi \/etc\/dnf\/dnf.conf<\/p>\n<\/div><\/div>\n\n\n\n
Check packages left from CentOS 7 by using the rpm command:<\/p>\n\n\n\n
\n
rpm -qa | grep ‘\\.el7’<\/p>\n<\/div><\/div>\n\n\n\n
You will get the similar output:<\/p>\n\n\n\n <\/figure>\n\n\n\nCheck dependencies and if any other packages depend on them.<\/p>\n\n\n\n
\n
for pkg in $(rpm -qa | grep ‘\\.el7’); do rpm -q –whatrequires $pkg; done<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nWe can proceed by removing the leftover packages:<\/p>\n\n\n\n
\n
sudo rpm -e $(rpm -qa | grep ‘\\.el7’)<\/p>\n<\/div><\/div>\n\n\n\n
Now we will clean up the package manager cache to free up space, remove any unnecessary data and verify the system integrity:<\/p>\n\n\n\n
\n
sudo dnf clean all sudo dnf autoremove -y sudo dnf check<\/p>\n<\/div><\/div>\n\n\n\n
We can then proceed to elevate-release package installation from the project repo:<\/p>\n\n\n\n
\n
sudo yum install -y http:\/\/repo.almalinux.org\/elevate\/elevate-release-latest-el$(rpm –eval %rhel).noarch.rpm<\/p>\n<\/div><\/div>\n\n\n\n
Next install leapp packages and migration data again:<\/p>\n\n\n\n
\n
sudo yum install -y leapp-upgrade leapp-data-almalinux<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nFor the transition between AlmaLinux 8 and AlmaLinux 9, it is recommended to disable SELinux and also the firewalld ZoneDrifting feature.<\/p>\n\n\n\n
First, edit the SELinux configuration file and change to option ‘disabled<\/strong>‘.<\/p>\n\n\n\n\n
sudo vi \/etc\/sysconfig\/selinux<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nReboot the server to apply the changes:<\/p>\n\n\n\n
\n
sudo reboot<\/p>\n<\/div><\/div>\n\n\n\n
After the reboot, log in to your system and edit the firewalld option:<\/p>\n\n\n\n
\n
sudo vi \/etc\/firewalld\/firewalld.conf<\/p>\n<\/div><\/div>\n\n\n\n
Here we will set AllowZoneDrifting<\/strong> option to ‘no<\/strong>‘<\/p>\n\n\n\n <\/figure>\n\n\n\nSave the file and run the pre-upgrade check, to make sure everything is prepared for the upgrade:<\/p>\n\n\n\n
\n
sudo leapp preupgrade<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nBased on the output, we need to confirm the answer again:<\/p>\n\n\n\n
\n
sudo leapp answer –section check_vdo.no_vdo_devices=True<\/p>\n<\/div><\/div>\n\n\n\n
In the report, we also got the error for the network configuration:<\/p>\n\n\n\n
\n
Network configuration for unsupported device types detected Summary: RHEL 9 does not support the legacy network-scripts package that was deprecated in RHEL 8 in favor of NetworkManager. Files for device types that are not supported by NetworkManager are present in the system. Files with the problematic configuration: – \/etc\/sysconfig\/network-scripts\/ifcfg-enp0s3<\/p>\n<\/div><\/div>\n\n\n\n
The official recommendation from the AlmaLinux team is to consider removing the file.<\/p>\n\n\n\n
\n
sudo rm \/etc\/sysconfig\/network-scripts\/ifcfg-enp0s3<\/p>\n<\/div><\/div>\n\n\n\n
Review the exact file name from the report in your case, as it can be different.<\/p>\n\n\n\n
We can also remove the make-devel package as it can often conflict with the upgrade process:<\/p>\n\n\n\n
\n
sudo dnf remove make-devel<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nNow we can proceed to the upgrade by running the command:<\/p>\n\n\n\n
\n
sudo leapp upgrade<\/p>\n<\/div><\/div>\n\n\n\n
This will take some time and after the process, we need to reboot again.<\/p>\n\n\n\n <\/figure>\n\n\n\n\n
sudo reboot<\/p>\n<\/div><\/div>\n\n\n\n
After the process, log in to your system and check the current version:<\/p>\n\n\n\n
\n
cat \/etc\/os-release<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nIt is recommended that you check logs and packages left from the previous OS version, so consider removing them in a similar way we did for old CentOS 7 packages.<\/p>\n\n\n\n
\n
rpm -qa | grep el8 sudo cat \/var\/log\/leapp\/leapp-report.txt sudo cat \/var\/log\/leapp\/leapp-upgrade.log<\/p>\n<\/div><\/div>\n\n\n\n
Migrating from CentOS 7 to AlmaLinux is a crucial step to ensure your systems remain secure and supported beyond the CentOS 7 end-of-life date. By following this guide, you can migrate your system with minimal disruption and ensure a smooth transition to newer AlmaLinux versions.<\/p>\n","protected":false},"excerpt":{"rendered":"
Learn how to upgrade to CentOS 7 in this step-by-step tutorial.<\/p>\n","protected":false},"author":150,"featured_media":111556,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_oasis_is_in_workflow":0,"_oasis_original":0,"_oasis_task_priority":"","inline_featured_image":false,"footnotes":""},"categories":[2781],"tags":[],"collection":[2778],"platform":[],"funnel_stage":[3017],"coauthors":[2535],"acf":[],"yoast_head":"\n
How to Migrate CentOS 7 to AlmaLinux - 探花大神<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n\t \n\t \n\t \n