Back
04/03/2025
8. Switching From CentOS to Oracle Linux
In December 2020, the official CentOS blog announced that development of CentOS would end and that it would be transitioned to CentOS Stream. The announcement of the end of CentOS, which had previously had an overwhelming presence as a RHEL-compatible distribution (RHEL clone), came as a big surprise.
Nearly three years have passed since the announcement of the end of CentOS in 2020, and various alternatives to CentOS have appeared. In this article, we will explain the current situation of CentOS and after-CentOS, and how to switch to Oracle Linux, which is a promising migration destination.
CentOS End and CentOS Stream
To understand the current situation of CentOS, we will explain the overview of the end of CentOS and the new CentOS Stream.
CentOS End of Life Announcement
The announcement of the end of CentOS was published on the official CentOS blog, ” CentOS Project shifts focus to CentOS Stream .”

The contents of this blog can be summarized as follows:
- CentOS 8 will end support on December 31, 2021
- CentOS 7 will be supported until June 30, 2024 as usual.
- CentOS will transition to CentOS Stream in the future
- CentOS Stream is the upstream (development) branch of RHEL. It is positioned differently from traditional rebuilds.
- CentOS 8 users are encouraged to migrate to CentOS Stream, which has fewer differences, or to RHEL if they are concerned about using it in a production environment.
Furthermore, from the user’s perspective, this can be expressed as follows:
- Support for CentOS will end soon, so you need to consider migrating immediately.
- At the moment (September 2023), support for CentOS 8 has ended, and support for CentOS 7 will end in June 2024. After support ends, update packages will no longer be provided and the Yum repository will no longer be available.
- No update packages are provided, increasing security risks
- CentOS Stream is not a rebuild of RHEL like CentOS, but is positioned as a development version. Therefore, there are issues with using it in a production environment, at least.
Differences between CentOS and CentOS Stream
CentOS was a RHEL-compatible Linux distribution, also known as a RHEL clone. Therefore, it is compatible with RHEL and is almost identical at the source code level. By the way, I introduced the following diagram in the previous article, ” Are you using Oracle Linux? (Part 1) “.
On the other hand, CentOS Stream is a Nightly build of RHEL that is released on a rolling release basis. A Nightly build is a build generated using the latest source code of a development project and is different from the official release version.
It’s a little difficult to understand because it’s different from what we’ve had up until now, but the following diagram published by the CentOS Project should help. For example, RHEL 8 (≓ CentOS 8) was created by branching off Fedora 28. 8.2 and 8.3 were then released in that order, and errata were created for each. Depending on the OS settings, it’s also possible to update from 8.3 to the latest 8.8.
Source: CentOS Stream is Continuous Delivery licensed CC BY-SA 4.0
CentOS Stream is a rolling release system, so there are no minor versions like 8.2 or 8.3. It just has the release date. If you look at the ISO image published on the mirror site20230825
, it has a date like this. Also, the 20230825
and on the mirror site latest
are the same, and latest
the contents of are always updated.
Also, when looking at the individual package level, there is no guarantee that CentOS Stream and RHEL are identical. Since changes are made to CentOS Stream first, when comparing the latest versions, CentOS Stream is newer and can be considered a version that has not yet been tested in production.

I hope you understand that although CentOS and CentOS Stream are functionally similar, their positions are quite different. That is why it caused such a stir around the world. The differences between CentOS and CentOS Stream are described in detail in Red Hat’s “Akahato Engineer Blog: The Relationship Between Fedora/CentOS Stream/CentOS/RHEL .” Please take a look if you are interested.
Support period for each Linux distribution
This article introduces the support period for RHEL-based Linux distributions. The only CentOS version that is currently supported is CentOS 7, which will be supported until June 30, 2024. There is no CentOS 9. Therefore, if you are currently using CentOS, you will need to migrate to one of the other Linux distributions.
Version | End of support(*1) |
---|---|
CentOS 7 | 2024/06/30 |
CentOS 8 | 2021/12/31 |
CentOS Stream 8 | 2024/05/31 |
CentOS Stream 9 | Undecided (scheduled to be the same as RHEL9) |
Red Hat Enterprise Linux 7 | 2024/06/30 |
Red Hat Enterprise Linux 8 | 2029/05/31 |
Red Hat Enterprise Linux 9 | 2032/05/31 |
Oracle Linux 7 | 2024/12 |
Oracle Linux 8 | 2029/07 |
Oracle Linux 9 | 2032/06 |
*1: The end of support for Oracle Linux is the end of Premier Support. Extended Support and Sustaing Support will be provided for a longer period.
CentOS migration options
Let’s consider the Linux distributions that are candidates for migration from CentOS. Considering ease of migration, RHEL series is the best, and the main options are as follows:
- CentOS Stream
- Red Hat Enterprise Linux
- Oracle Linux
- AlmaLinux
- Rocky Linux
- MIRACLE LINUX
- Amazon Linux
AlmaLinux and Rocky Linux are Linux distributions that were born out of the backlash against the demise of CentOS. Both are sponsored by major companies and are also offered on the public cloud.
Which one you choose depends on factors such as your purpose and budget, so it is difficult to say which one is unconditionally better. The following table compares them from the perspective of enterprise use. For enterprise use, important factors include the length of the support period, whether or not paid support is available, whether or not supported hardware is available, whether or not commercial packages are supported, and the cost.
Distribution | License/Subscription | Paid support | Migration Method | Cons and negative points |
---|---|---|---|---|
CentOS Stream | Not required | none | Replacing a repository | It seems to be highly stable, but you need to be careful. It is not compatible with the traditional RHEL, so there is no supported hardware and commercial packages are not supported. Can you convince your boss or customers? |
Red Hat Enterprise Linux | need | can be | Migration tools available | Industry leader, but requires subscription and Red Hat Enterprise Agreement |
Oracle Linux | Not required, but some features are available only to paid support users | can be | Migration tools available | It has a long track record and is used for mission-critical applications such as Exadata. It is not well-known among users of Oracle products. |
AlmaLinux/Rocky Linux | Not required | Paid support available (including third-party support) | Migration tools available | It’s a new distribution so you need to watch it. |
Amazon Linux | Not required | can be | No vendor-supplied tools | It can be used on-premise and has high compatibility with AWS. Since it is based on Fedora, compatibility is not high and the support period is short at about 5 years. |
MIRACLE LINUX | Not required | can be | Migration tools available | Although it has a long track record, it is not well known among domestic vendors. |
Switch from CentOS to Oracle Linux using migration tools
centos2ol.sh
Oracle Linux provides a script that switches CentOS to Oracle Linux in place . This time, we will use this script to switch CentOS 8 to Oracle Linux 8. The procedure for switching to CentOS 7 is almost the same.
Oracle has released several documents, so in this column we will go into some depth about some of them while highlighting the main points.
- Switching from CentOS 8 to Oracle Linux 8
- Switching from CentOS Linux to Oracle Linux
- Github: Switch from CentOS/Rocky Linux to Oracle Linux
To run the migration script:
The steps to run the migration script are as follows. The preparatory steps 1 to 3 require multiple commands. However, the migration steps 4 and 5 can be performed with a minimal number of commands.
- Check the restrictions
- System backup (omitted in the text)
- Preparing the source CentOS
- Migration script execution
- Post-migration verification
Check the restrictions
The limitations of the migration tool are as follows. For now, you only need to be aware of these limitations, and we will check them in the next section, “Preparation of the source CentOS.”
- Source is CentOS 6, 7, 8 or Rocky Linux 8, 9
- Access to the CentOS and Oracle Linux Yum repositories, either directly or via a proxy
- The instance is not registered with a third-party package management tool such as Spacewalk.
- If you have installed packages from sources other than the official CentOS repository, they may be compatible, but we do not guarantee that they will work. Some software
/etc/oracle-release
may cause problems if they are installed. - If some kernel modules are installed, such as commercial antivirus products or hardware drivers, they may not work after switching.
- The migration script only enables the base repositories, such as base, updates, and BaseOS. If you have installed packages from other repositories, you may need to enable additional repositories.
- /var/cache has at least 5GB of free space
Preparing the source CentOS
Here we will make sure that we are not violating any script restrictions.
Please note that the preparatory steps require administrator privileges, so you must either put sudo before the command or use su to run it as the root user. I’ve omitted sudo to emphasize the simplicity of the appearance. Also, CentOS 8 recommends dnf instead of yum, but I’ve stuck to yum because it’s compatible.
1. Check the CentOS version
Log in to the source and check the CentOS version. If it is 8 as shown below, there is no problem.
# cat /etc/centos-release
CentOS Linux release 8.3.2011
2. Check connection to CentOS Yum repository
Check if you can connect to the CentOS Yum repository. CentOS 8 no longer has a repository on the mirror site, so if you cannot connect, you will get the following error:
# yum check-update
CentOS Linux 8 - AppStream 51 B/s | 38 B 00:00
エラー: repo 'appstream' のメタデータのダウンロードに失敗しました : Cannot prepare internal mirrorlist: No URLs in mirrorlist
If an error occurs, change the repository you are pointing to by running the following command:
# sed -i -e 's/^mirrorlist/#mirrorlist/g' -e 's/^#baseurl=http:\/\/mirror/baseurl=http:\/\/vault/g' /etc/yum.repos.d/CentOS-*repo
If the repository is available, the repository metadata will be downloaded and updatable packages will be displayed as shown below.
# yum check-update CentOS Linux 8 - AppStream 16 MB/s | 8.4 MB 00:00
CentOS Linux 8 - BaseOS 9.2 MB/s | 4.6 MB 00:00
CentOS Linux 8 - Extras 46 kB/s | 10 kB 00:00
NetworkManager.x86_64 1:1.32.10-4.el8 baseos
NetworkManager-libnm.x86_64 1:1.32.10-4.el8 baseos
3. Verify that there are no problematic packages
Check for kernels and packages installed outside of the base repositories (anaconda, base, baseos, updates, AppStream, etc.). Kernels are particularly problematic, so remove the centosplus kernel if one is present.
Displays the installed kernel. The repository name from which it was installed is displayed on the far right. This is fine in this example.
# yum list installed kernel
kernel.x86_64 4.18.0-240.el8 @anaconda
To check not only the kernel but also packages installed from other than the base repository, use the following command. If there are packages installed from third-party repositories such as EPEL, the relevant packages will be displayed. However, user space packages are rarely an issue.
# rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{VENDOR}\n' | grep -v "CentOS"
4. Check the base repository
Verify that the base repositories are enabled. If they are disabled, enable them.
# yum repolist
repo id repo の名前
appstream CentOS Linux 8 - AppStream
baseos CentOS Linux 8 - BaseOS
extras CentOS Linux 8 - Extras
If any repositories are disabled, enable them.
# dnf config-manager --enable BaseOS AppStream extras
Also, if the following message beginning with “This system is” is displayed at the beginning, the system is registered with Spacewalk, etc. The migration script cannot be used, so either remove it from management or give up using the script.
# yum repolist
...
This system is receiving updates from Red Hat Satellite or Spacewalk server
repo id repo name
5. Package Updates
Update the packages to the latest version. Although updating to the latest version is not required, it will be updated when you run the migration script, so it will be the same in the end.
# yum update -y
6. Check the free disk space
Verify that /var/cache has at least 5GB of free space.
# df -h /var/cache
ファイルシス サイズ 使用 残り 使用% マウント位置
/dev/mapper/cl_centos8-root 47G 1.7G 46G 4% /
7. Disable automatic package updates
If automatic package updates are activated while the migration script is running, they will not function properly, so they must be disabled. CentOS has two types of automatic package updates:
- yum-cron (CentOS 7) or dnf-automatic (CentOS 8)
- Packagekit built into the desktop environment
If you don’t have the desktop installed, check yum-cron or dnf-automatic. If you have the desktop installed, you should check both.
7-1. Disable dnf-automatic
Check if dnf-automatic is installed. If nothing is displayed as below, proceed to “7-2. Disable Packagekit”.
# rpm -qa | grep dnf-automatic
★何も表示されなければインストールされていません
When installed, check the timer settings. In the following example, automatic downloads (dnf-automatic-download.timer) are enabled.
# systemctl list-unit-files --type=timer | grep dnf-auto
dnf-automatic-download.timer enabled
dnf-automatic-install.timer disabled
dnf-automatic-notifyonly.timer disabled
dnf-automatic.timer disabled
If any of them are enabled, disable them all.
# systemctl disable dnf-automatic-download.timer --now
7-2. Disable Packagekit
If you have a GUI environment installed, check Packagekit.
# systemctl status packagekit
When it says “active (running)” as shown in the ★ mark, it is running. If the Packagekit service itself does not exist, it will say “Unit packagekit.service could not be found.” This is not relevant in this case.
● packagekit.service - PackageKit Daemon
Loaded: loaded (/usr/lib/systemd/system/packagekit.service; static; vendor preset: disabled)
Active: ★active (running)★ since Tue 2023-08-15 09:31:27 GMT; 59s ago
Main PID: 21960 (packagekitd)
Tasks: 3
CGroup: /system.slice/packagekit.service
└─21960 /usr/libexec/packagekitd
Dec 15 09:31:26 centos7 systemd[1]: Starting PackageKit Daemon...
Dec 15 09:31:27 centos7 PackageKit[21960]: daemon start
Dec 15 09:31:27 centos7 systemd[1]: Started PackageKit Daemon.
When Packagekit is running, stop the service and turn off automatic startup.
# systemctl disable packagekit --now
8. Download the migration script
Download the migration script. If you need a proxy to access the Internet, specify the proxy server in --proxy
the options or environment variables.https_proxy
# curl -O https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
Check the available options.
# bash centos2ol.sh -h
Usage: centos2ol.sh [OPTIONS]
OPTIONS
-h
Display this help and exit
-k
Do not install the UEK kernel and disable UEK repos
-r
Reinstall all CentOS RPMs with Oracle Linux RPMs
Note: This is not necessary for support
-V
Verify RPM information before and after the switch
Running the Migration Scripts
Now that everything is ready, run the migration script to switch to Oracle Linux. The time it takes to run depends on the number of packages installed, the line speed, and the performance of the machine. In the environment I tested, it took about 10 to 60 minutes.
# bash centos2ol.sh
If the script runs successfully, the following message is displayed:
Sync successful.
Updating the GRUB2 bootloader.
Generating grub configuration file ...
done
Switching default boot kernel to the UEK.
Removing yum cache
Switch complete.
Oracle recommends rebooting this system.
Follow the message to restart the system.
# systemctl reboot
Post-migration verification
After reboot, check how your system is.
- /etc/oracle-release has been added and /etc/centos-release has been removed.
$ ls -l /etc/*-release
-rw-r--r--. 1 root root 32 8月 7 00:03 /etc/oracle-release
-rw-r--r--. 1 root root 489 8月 7 00:03 /etc/os-release
-rw-r--r--. 1 root root 45 8月 7 00:03 /etc/redhat-release
lrwxrwxrwx. 1 root root 14 8月 7 00:03 /etc/system-release -> oracle-release
- Before the migration, the version was CentOS 8.3, but now it is the latest Oracle Linux 8.8. If you migrate using the migration script, it will become the latest version.
$ cat /etc/oracle-release
Oracle Linux Server release 8.8
- The default kernel is UEK, not RHCK. If you do not want to use UEK,
centos2ol.sh -k
specify it when running the script as follows:
$ uname -r
5.4.17-2136.322.6.2.el8uek.x86_64
- Check if any CentOS packages remain. The following kernels are displayed. These are not in use, so they can be deleted.
$ rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{VENDOR}\n' | grep CentOS | sort -n
kernel-4.18.0-240.el8 CentOS
kernel-core-4.18.0-240.el8 CentOS
kernel-modules-4.18.0-240.el8 CentOS
- Let’s go a step further and display the list of kernel-related packages. We can see that the previous CentOS kernel and the latest RHCK and UEK for Oracle Linux are installed.
# rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{VENDOR}\n' | grep kernel- | sort -n
kernel-4.18.0-240.el8 CentOS
kernel-4.18.0-477.21.1.el8_8 Oracle America
kernel-core-4.18.0-240.el8 CentOS
kernel-core-4.18.0-477.21.1.el8_8 Oracle America
kernel-modules-4.18.0-240.el8 CentOS
kernel-modules-4.18.0-477.21.1.el8_8 Oracle America
kernel-tools-4.18.0-477.21.1.el8_8 Oracle America
kernel-tools-libs-4.18.0-477.21.1.el8_8 Oracle America
kernel-uek-5.4.17-2136.322.6.2.el8uek Oracle America
- Check the enabled repositories, you will see they have been replaced with Oracle Linux ones.
yum repolist
repo id repo の名前
ol8_UEKR6 Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64)
ol8_appstream Oracle Linux 8 Application Stream (x86_64)
ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64)
Conclusion
By using the migration script, you can see that it is very easy to switch from CentOS to Oracle Linux. The most troublesome part is the preliminary check work. Also, although it was not explained in the main text, be sure to make a backup before running it.
summary
- CentOS support is ending soon, so you need to migrate quickly.
- Oracle Linux is a likely migration target
- The migration script centos2ol.sh makes it easy to switch from CentOS to Oracle Linux.
- The migration time is about 10 to 60 minutes per server. It depends on the number of installed packages, server performance, and line speed.
- The script has some limitations, such as being able to connect to internet repositories.
The RHEL clone industry has been in turmoil since the end of 2020, but in 2023, there is another uproar. Red Hat has previously released the RHEL source code, but has announced that it will not be made public in the future (see the link below). In response, some vendors have announced countermeasures. Oracle has not only been developing Oracle Linux for many years, but also Solaris, so you may feel safe in this area.