In this tutorial, you will learn on how to upgrade your operating system from CentOS 7 to AlmaLinux OS manually.
As always, before making any changes to your VPS, you should make a backup of your VPS - save all the essential data. It will be a wise option if anything goes wrong.
Steps:
- First of all, you need to update all the system packages and repositories:
sudo yum update -y
- Then you need to reboot your VPS:
sudo reboot
You might be disconnected from your VPS, so you will need to connect to your VPS again.
- After that, you need to install the elevate-release package with this command:
sudo yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm
After the installation is completed, the output should look something like this:
- The next step is to install leapp-data-almalinux package:
sudo yum install -y leapp-upgrade leapp-data-almalinux
- Then, you need to initiate a pre-upgrade check. Down below provided command runs the checks to see if the upgrade will be successful or not and provides a report of possible remediations:
sudo leapp preupgrade
If due to some reason the test fails, all the reasons will be saved in a file that path is /var/log/leapp/answerfile.
- If pre-upgrade is successful, you will need to run these commands:
sudo rmmod pata_acpi
echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
sudo leapp answer --section remove_pam_pkcs11_module_check.confirm=True
- Now, you can run the following command to migrate your OS from CentOS 7 to AlmaLinux:
sudo leapp upgrade
It might take up some time, so be patient.
Then reboot your VPS again:
sudo reboot
It might take up to 20-30 minutes; meanwhile, the server will not be accessible via SSH. Do not worry, you can try to access your VPS via Emergency Console and watch how the files are installing.
When the installation is completed, you will be asked to log in. So then you can try to connect to your VPS as root.
Once you log in to your VPS, you can run this command to check your OS version:
cat /etc/redhat-release
If AlmaLiux was installed, you should see a similar output:
And that's it, you have upgraded your OS successfully to AlmaLinux!