How to Seamlessly Migrate CentOS 7 to Modern Alternatives Using Leapp and Manual Methods
This article explains why CentOS 7 is reaching end‑of‑life, reviews community and domestic alternatives such as Rocky Linux, AlmaLinux, Anolis OS, openEuler and Galaxy Kirin, and provides detailed automatic (Leapp) and manual (dnf distro‑sync) upgrade procedures with code examples for a smooth migration.
Background
CentOS 7's lifecycle ends on June 30, 2024; the community switched to CentOS Stream, shortening CentOS 8's lifecycle and prompting users to look for other distributions.
Users value Red Hat's backing; as a downstream of RHEL, CentOS offers tested packages and Red Hat‑supported maintenance.
The original CentOS model limited user contributions, while CentOS Stream lets users contribute patches, though RHEL inclusion remains Red Hat's decision.
Fedora focuses on upstream features; CentOS Stream provides a stable upstream for contributors; RHEL offers enterprise support.
CentOS Stream diverges from the original expectations of CentOS 7 users, leading them to seek replacements, especially amid the domestic‑software wave.
Community alternatives
Rocky Linux
Rocky Linux aims to function as a downstream build as CentOS had done previously, building releases after they have been added to the upstream vendor, not before.
AlmaLinux
AlmaLinux OS is replacing CentOS as the downstream rebuild of Red Hat Enterprise Linux.
Both aim to be downstream rebuilds of RHEL, preserving the original CentOS release model.
Domestic alternatives
Anolis OS (Alibaba)
Anolis OS 8 is an open‑source, neutral, open distribution from the OpenAnolis community, supporting multiple architectures, optimized for cloud scenarios, and compatible with the CentOS software ecosystem.
openEuler (Huawei)
openEuler is an open‑source operating system based on Linux, supporting Kunpeng and other processors, suitable for databases, big data, cloud computing, AI, and more, built by a global open‑source community.
Galaxy Kirin OS
Galaxy Kirin Advanced Server OS V10 provides enterprise‑grade reliability, security, performance, scalability, and real‑time capabilities, meeting CMMI‑5 standards and supporting cloud‑native workloads.
For Xinchuang compliance, only Galaxy Kirin meets the standards; otherwise Rocky, Alma, and Anolis offer easier migration paths, while openEuler is a good choice for domestic hardware support.
Comparison selection
Choose Galaxy Kirin for Xinchuang compliance; otherwise Rocky/Alma/Anolis for ease of use; openEuler for hardware compatibility.
All listed distributions use RPM as the package manager; CentOS 7 uses Yum, while the others use DNF.
Upgrade conversion
To replace CentOS 7, you can either reinstall the OS or perform an in‑place upgrade.
In‑place upgrades can be automatic (using Leapp) or manual.
Automatic process
Leapp is an open‑source workflow framework developed by Red Hat. It defines Actors, Models, Messages, and Workflows with phases (preupgrade, upgrade, firstboot) and stages (Before, Main, After). The workflow runs checks, downloads packages, prepares an initramfs, performs the RPM upgrade, and finalizes the system.
Pre‑upgrade: collect environment information and perform extensive checks (CPU, OpenSSH, PAM, drivers, NTP, SAP HANA, Memcached, etc.).
Upgrade: uses the same workflow and includes configuration_phase, FactsCollection, Checks, TargetTransactionFactsCollection, TargetTransactionCheck, Reports, Download, InterimPreparation (dracut), and other steps.
Interim Upgrade: executes the RPM upgrade in a minimal target environment.
Firstboot: cleanup actions and final configuration after reboot.
Leapp repositories for each target distribution (Rocky, Alma, Anolis) provide specific Actors.
from leapp.actors import Actor
from leapp.libraries.actor.checkntp import check_ntp
from leapp.models import InstalledRedHatSignedRPM, NtpMigrationDecision, Report
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
class CheckNtp(Actor):
"""Check if ntp and/or ntpdate configuration needs to be migrated."""
name = 'check_ntp'
consumes = (InstalledRedHatSignedRPM,)
produces = (Report, NtpMigrationDecision)
tags = (ChecksPhaseTag, IPUWorkflowTag)
def process(self):
installed_packages = set()
signed_rpms = self.consume(InstalledRedHatSignedRPM)
for rpm_pkgs in signed_rpms:
for pkg in rpm_pkgs.items:
installed_packages.add(pkg.name)
self.produce(check_ntp(installed_packages))The Actor calls the check_ntp function:
# Check services from the ntp packages for migration
def check_ntp(installed_packages):
service_data = [
('ntpd', 'ntp', '/etc/ntp.conf'),
('ntpdate', 'ntpdate', '/etc/ntp/step-tickers'),
('ntp-wait', 'ntp-perl', None),
]
migrate_services = []
migrate_configs = []
for service, package, main_config in service_data:
if package in installed_packages and \
check_service('{}.service'.format(service)) and \
(not main_config or is_file(main_config)):
migrate_services.append(service)
if main_config:
migrate_configs.append(service)
if migrate_configs:
reporting.create_report([
reporting.Title('{} configuration will be migrated'.format(' and '.join(migrate_configs))),
reporting.Summary('{} service(s) detected to be enabled and active'.format(' and '.join(migrate_services))),
reporting.Severity(reporting.Severity.LOW),
reporting.Groups([reporting.Groups.SERVICES, reporting.Groups.TIME_MANAGEMENT]),
] + related)
config_tgz64 = get_tgz64(files)
else:
api.current_logger().info('ntpd/ntpdate configuration will not be migrated')
migrate_services = []
config_tgz64 = ''
return NtpMigrationDecision(migrate_services=migrate_services, config_tgz64=config_tgz64)Manual process
RPM‑based upgrade using dnf distro-sync after installing DNF and configuring repositories, handling dependency conflicts, and removing Yum.
Upgrade CentOS 7 to the latest 7.x release.
Stop all running applications.
Configure the CentOS 7 repository and install DNF (which may require upgrading glib2).
Remove Yum to avoid conflicts.
Configure the target distribution repository.
Run dnf distro-sync to synchronize RPMs.
Remove unnecessary RPMs with dnf remove.
Reboot the host.
RPM version handling cases include upgrade, downgrade, replacement, reinstall, uninstall, and ignore.
Conclusion
Both automatic (Leapp) and manual (dnf distro‑sync) methods enable in‑place migration from CentOS 7 to the desired target distribution; community‑backed Rocky, Alma, and Anolis support automatic upgrades, while openEuler can be handled manually, reducing migration effort.
References
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/upgrading_from_rhel_7_to_rhel_8/index
https://www.itzgeek.com/how-tos/linux/centos-how-tos/how-to-upgrade-centos-7-to-rocky-linux-8.html
https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch05s02.html
https://copyprogramming.com/howto/rpmlib-filedigests-dependency-error-on-suse
https://lists.fedoraproject.org/archives/list/[email protected]/thread/VVVD6QQUARKZJ5RBV46IQBYMSKYPT4YO/
https://github.com/uyuni-project/uyuni/issues/4000
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
