Home Almalinux Migrate To AlmaLinux 8 From CentOS 8 Using Almalinux-deploy Script

Migrate To AlmaLinux 8 From CentOS 8 Using Almalinux-deploy Script

By sk
8k views

This step by step tutorial explains how to migrate to AlmaLinux 8 from CentOS 8 using Almalinux-deploy script. Using Almalinux-deploy script, we can easily convert CentOS machines (hopefully other Enterprise Linux systems) to AlmaLinux.

It is written in Bash and the source code is available in GitHub. Now let us go ahead and migrate from CentOS to AlmaLinux with almalinux-deploy script.

If you don't want to upgrade but want to do a fresh AlmaLinux installation, refer the following guide:

Migrate to AlmaLinux from CentOS 8 using almalinux-deploy script

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
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
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:

Boot into AlmaLinux
Boot into AlmaLinux

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

$ cat /etc/redhat-release 
AlmaLinux release 8.3 (Purple Manul)
Login to AlmaLinux
Login to AlmaLinux

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!!

We also have published an unofficial AlmaLinux migration method. If you're interested to know how to do it, take a look at the following link:

Migrate CentOS 7 to Any Enterprise Linux 8 With ELevate

Please note that the almalinux-deploy script will only convert CentOS 8 version to AlmaLinux 8. If you are running older versions like CentOS 7.x or 6.x, this script will not help.

Thankfully, the AlmaLinux developers have create a tool called ELevate to migrate CentOS 7 to any Enterprise Linux 8.x version.

ELevate is an open source migration tool developed by AlmaLinux team. It allows you to migrate between major versions of RHEL-based distributions from 7.x to 8.x version. For more details, refer the following guide.

Hope this helps.

Resource:

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More