Saturday, May 21, 2022

How to Migrate from CentOS 8 to AlmaLinux


 

A word of caution:

As usual, backup important data from your CentOS system before starting AlmaLinux migration task. I tested this script in a freshly installed CentOS 8 virtual machine. My VM doesn't has any data and it is a server edition with minimal installation. It worked just fine without any issues as expected.


Step 1: Update your CentOS system to latest available version as root or sudo user:

$ sudo dnf update

Step 2: Reboot your system to apply the updates:

$ sudo reboot

Let us check the current CentOS 8 version:

$ cat /etc/redhat-release

CentOS Linux release 8.3.2011

Yes, it is the latest version!

Step 3: Download the almalinux-deploy script using command:

$ curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh

Step 4: Go to the location where you downloaded the script and run the script to start Almalinux migration:

$ sudo bash almalinux-deploy.sh

This command will install some new packages, upgrade and downgrade some existing packages, reinstall a few packages and uninstall some packages.

This will take a couple minutes depending upon the Internet connection speed and the total number of installed packages in your CentOS system.

Sample output:

 Check root privileges                                                 OK

 Check Secure Boot disabled                                            OK

 Check centos-8.x86_64 is supported                                    OK

 Download RPM-GPG-KEY-AlmaLinux                                        OK

 Import RPM-GPG-KEY-AlmaLinux to RPM DB                                OK

 Download almalinux-release package                                    OK

 Verify almalinux-release package                                      OK

 Remove centos-linux-release package                                   OK

 Remove centos-gpg-keys package                                        OK

 Remove centos-linux-repos package                                     OK

 Verifying…                          ################################# [100%]

 Preparing…                          ################################# [100%]

 Updating / installing…

    1:almalinux-release-8.3-4.el8      ################################# [100%]

 Install almalinux-release package                                     OK

 determining the fastest mirror (55 hosts).. done.    [===                                             ] ---  B/s |   0  B     --:-- ETA

 AlmaLinux 8 - BaseOS                                                                                    125 kB/s | 3.4 MB     00:27    

 AlmaLinux 8 - AppStream                                                                                 155 kB/s | 6.8 MB     00:44    

 AlmaLinux 8 - PowerTools                                                                                589 kB/s | 2.1 MB     00:03    

 AlmaLinux 8 - Extras                                                                                    3.3 kB/s | 3.6 kB     00:01    

 Dependencies resolved.

  Package                                 Architecture     Version                                             Repository           Size

 Upgrading:

  NetworkManager                          x86_64           1:1.26.0-13.el8_3                                   baseos              2.4 M

  NetworkManager-libnm                    x86_64           1:1.26.0-13.el8_3                                   baseos              1.7 M

  NetworkManager-team                     x86_64           1:1.26.0-13.el8_3                                   baseos              141 k

  NetworkManager-tui                      x86_64           1:1.26.0-13.el8_3                                   baseos              319 k

  dbus                                    x86_64           1:1.12.8-12.el8_3                                   baseos               40 k

  dbus-common                             noarch           1:1.12.8-12.el8_3                                   baseos               44 k

  dbus-daemon                             x86_64           1:1.12.8-12.el8_3                                   baseos              239 k

  dbus-libs                               x86_64           1:1.12.8-12.el8_3                                   baseos              182 k

  dbus-tools                              x86_64           1:1.12.8-12.el8_3                                   baseos               84 k

  device-mapper                           x86_64           8:1.02.171-5.el8_3.2                                baseos              372 k

[...]

Migrate to AlmaLinux from CentOS 8 using almalinux-deploy script

If the migration is successful, you will see the following message:


[...]

Complete!

Run dnf distro-sync -y                                                OK

AlmaLinux migration is completed


Step 5: Run the following command to synchronize installed packages to the latest available versions.

$ sudo dnf distro-sync -y 


Step 6: Reboot your system:

$ sudo reboot

Now your system will boot into the newly migrated AlmaLinux system:


Step 7: Login to your AlmaLinux system and check its version:

$ cat /etc/redhat-release 

AlmaLinux release 8.3 (Purple Manul)

Congratulations! AlmaLinux migration is successful!!


Step 8: You could have used the word "centos" in hostname and username. Simply change them wherever necessary to reflect AlmaLinux.

I am going to update the hostname:

$ sudo hostnamectl set-hostname almalinux8

Replace almalinux8 with your preferred hostname in the above command.


Step 9: Log out and log back in to verify if the changes have been made:

$ hostname

almalinux8

Yes, the changes are updated!


Check that the system boots AlmaLinux kernel by default using command:

$ sudo grubby --info DEFAULT | grep AlmaLinux

Sample output:

title="AlmaLinux (4.18.0-240.15.1.el8_3.x86_64) 8.3 (Purple Manul)"

All good! Start using your AlmaLinux!!

0 comments:

Post a Comment