Script and documentation to switch CentOS Linux to Oracle Linux
This script is designed to automatically switch a CentOS instance to Oracle Linux by removing any CentOS-specific packages or replacing them with the Oracle Linux equivalent.
This script currently supports switching CentOS Linux 6, CentOS Linux 7 and CentOS Linux 8. It does not support CentOS Stream.
IMPORTANT: this script is a work-in-progress and is not designed to handle all possible configurations. Please ensure you have a complete backup of the system before you start this process in the event the script is unable to convert the system successfully.
Because of the GRUB2 BootHole vulnerability, our SecureBoot shim can only boot kernels signed by Oracle and we can only replace the default CentOS kernels. While this may not have an impact if SecureBoot is currently disabled, enabling it at a later date could render the system unbootable. For that reason, we strongly recommend removing all non-standard kernels, i.e. any kernel that is installed that is not provided by either the
baseor
updatesrepo. This includes the
centospluskernels.
yumor
dnfconfiguration is working, i.e. there are no stale repositories.
/var/cache.
yum-cronshould be disabled.
sudoprivileges.
centos2ol.shscript.
sudo bash centos2ol.shto switch your CentOS instance to Oracle Linux.
-rReinstalls all CentOS RPMs with Oracle Linux RPMs
If a system is swiched to Oracle Linux and there is no newer Oracle Linux version of a package already installed then the CentOS version remains. This option proceeds to reinstall any CentOS RPM with an identical version from Oracle Linux. This is not necessary for support and has no impact to a systems functionality but is offered so a user can remove CentOS GPG keys from the truststore. A list of all non-Oracle RPMs will be displayed after the reinstall process.
-VVerify RPM information before and after the switch
This option creates four output files in
/var/tmp/:
${hostname}-rpms-list-[before|after].log: a sorted list of installed packages
beforeand
afterthe switch to Oracle Linux.
${hostname}-rpms-verified-[before|after].log: the RPM verification results for all installed packages
beforeand
afterthe switch to Oracle Linux.
alternativesconfiguration during a
dnf reinstalltransaction.
We recommend recording the output of
alternatives --listprior to running
centos2ol.shand reviewing the same output after switching. If you experience an issue with a package other than OpenJDK, please open an issue
/etc/oracle-releasefile, for example.
Run
sudo bash -x centos2ol.shto switch your CentOS instance to Oracle Linux in debug mode. This will print a trace of commands and their arguments or associated word lists after they are expanded but before they are executed.
We welcome contributions! See our contribution guidelines.
For more information on Oracle Linux, please visit oracle.com/linux.
Copyright (c) 2020, 2021 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/