Upgrade CentOS 7 to Alma 8 While Keeping SingularityCE Updated

By Staff

Nov 2, 2023 | Blog, How To Guides


With CentOS 7 reaching end of life on June 30th, 2024 and CentOS 8 already discontinued in favor of CentOS Stream, users of open source SingularityCE might find themselves in a situation where a migration to another open source operating system is necessary. While there are several options to choose, whether it be Redhat Enterprise Linux, Alma Linux, Rocky Linux, Ubuntu or a variety of others to choose, here is a sample migration from CentOS 7 to Alma Linux 8 along with ensuring installation of the corresponding Singularity CE packages.

This blog post will guide you through the process of migrating to the AlmaLinux 8 distribution. In order to achieve success, the Alma project recommends using their Elevate tool to ensure a smooth transition.

Step 1: Patch and Update

In CentOS 7, we’ll use the yum package manager to install the latest updates including SingularityCE. If you have yet to install SingularityCE on CentOS 7, please read this detailed blog post to install SingularityCE from the RedHat EPEL repository. As of this writing, SingularityCE 3.11 is the latest version in EPEL.

To install the latest patches, run the following command:

$ sudo yum update
Once the update has finished, verify the CentOS and SingularityCE versions:
$ source /etc/os-release && echo $PRETTY_NAME
CentOS Linux 7 (Core)
$ singularity --version
singularity-ce version 3.11.5-1.el7
Note that the last characters of SingularityCE version line correspond to the current operating system version, so they should indicate “el7” for Enterprise Linux 7.

Step 2: Install the Elevate Repository

To enable the Alma ELevate migration tool, let’s enable the Elevate repository by running the following command:

$ sudo yum install -y \ http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm

Step 3: Install Leapp Utility

Leapp is a helper utility that assists with the migration of any previous version of Red Hat Enterprise Linux distribution to version 8. To migrate from CentOS 7 to AlmaLinux 8, install the following packages:

$ sudo yum install -y leapp-upgrade leapp-data-almalinux yum-utils

Step 4: Migrate to AlmaLinux 8

Once the leapp utility is installed, run a pre-flight upgrade by issuing the following command:

$ sudo leapp upgrade
The utility will assess if the system is ready. In our experience, CentOS 7 needs some additional adjustments to the system for a seamless migration procedure; failure to make these adjustments may lead to an unstable system.
For example, if you have multiple Kernels installed, or if the latest installed kernel does not correspond to the current one, you need to reboot the system and then clean up old kernels.
$ sudo package-cleanup --oldkernels --count=1
You can fix other issues by running the following command (note that you can revert them back after the upgrade, if needed):
$ sudo echo PermitRootLogin yes | sudo tee -a /etc/ssh/sshd_config
Next, the following command will remove the pam_pkcs11 module in the PAM configuration:
$ sudo leapp answer --section remove_pam_pkcs11_module_check.confirm=True

After fixing all the issues, we can return to the migration process:

$ sudo leapp upgrade
The process will inevitably take time, varying based on your system’s resource configuration:
Once the process finishes, reboot the system.
$ reboot
Once the system is booting up, you will see a new entry on the GRUB menu. Select “Elevate-Upgrade-Initramfs” and press Enter. This will install the remaining packages and will reconfigure your system. You can expect more reboots during this step.
Once the upgrade is complete, you may see a login screen. Type a username and password to log in. To confirm the update is complete, we need to a look at the operating system and SingularityCE version:
$ source /etc/os-release && echo $PRETTY_NAME
AlmaLinux 8.8 (Sapphire Caracal)
$ singularity --version
Singularity-ce version 3.11.5-1.el7

Step 5: Update the SingularityCE Package

Although SingularityCE 3.11 is verified, the “el7” package is still installed. To install the proper package for your operating system, upgrade the SingularityCE package with the following command:

$ sudo yum update -y singularity-ce
$ singularity --version
singularity-ce version 3.11.5-1.el8
Now we have the latest and a fully functional AlmaLinux 8 operating system with the corresponding SingularityCE package.


Migrating from CentOS 7 to AlmaLinux 8 is a crucial step for those seeking a reliable and secure open-source alternative to CentOS7. Proper planning and a clear understanding of the migration process and resources can make this transition smooth and beneficial, ensuring your systems remain updated and secure. With awareness of the essential steps and important considerations above, you can ensure a successful transition.

If you are new to Singularity containers or need a refresher, be sure to check out our free Singularity Container 101 course. The SingularityCE documentation referenced in this article (3.11) can be found at SingularityCE documentation. For updates on the fast-paced open source development, follow the SingularityCE project via Twitter.
Finally, if you have any questions or comments related to the information covered in this blog, connect with us! You can join our SingularityCE Slack Channel, connect with us on Google Groups, or start a discussion on GitHub! We can also be found on X at @Sinuglarity_CE. Whatever your preference, we are here to help and would be happy to take suggestions for future posts.

Join Our Mailing List

Recent Posts

Related Posts

Remote Building with OCI Registries

This blog post will demonstrate how to use a definition file in a remote build that references an Open Container Initiative (OCI) image stored in Singularity Enterprise and Singularity Container Services.First, create an account in Singularity Container Service. To do...

read more

OCI Basics using Singularity Enterprise Registry

Overview Singularity Enterprise comes with a fully compliant Open Container Initiative (OCI) registry. The following is a collection of typical registry operations within your workflow. Assuming the Singularity Enterprise registry address is registry.sylabs.io, please...

read more