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

Migrate To AlmaLinux From CentOS 8 Using Almalinux-deploy Script

By sk
Published: Last Updated on 4063 Views

Good news, Enterprise Linux users! AlmaLinux stable version is released!! It is time to convert your CentOS machines (hopefully other Enterprise Linux systems) to AlmaLinux using Almalinux-deploy script. The Almalinux-deploy script helps you to easily migrate to AlmaLinux from CentOS 8. It is written in Bash and the source code is available in GitHub.

A word of caution:

As usual, backup important data from your CentOS system before starting upgrade process. 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.

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

First, you need to find a way to upgrade older CentOS versions to CentOS 8.x and then migrate to AlmaLinux 8.x. As far as I know, there is no official way to upgrade CentOS 6.x/7.x to CentOS 8.x. The only way is reinstallation. It is a shame that there isn't any official method to migrate between major CentOS versions.

Now let us go ahead and convert from CentOS to AlmaLinux with almalinux-deploy script.

Migrate to AlmaLinux from CentOS 8 using almalinux-deploy script

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:

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. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More