Switch to Oracle Linux
Switching to Oracle Linux is as simple as running the
centos2ol.sh
script. This script will automatically switch a CentOS
instance to Oracle Linux by removing any CentOS-specific packages or replacing them with the
Oracle Linux equivalent.
This article will show you how to prepare your system, obtain and run the script, and then test it to ensure the migration is successful.
Prepare Your System
Before downloading and running the centos2ol.sh
script,
you need to ensure your system is ready to run it. This article will walk you through these
basic preparation steps.
Back Up Everything
This script 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 your system successfully.
Remove All Non-Standard Kernels
Oracle strongly recommends that you remove all non-standard kernels; that is, any installed kernel not provided by either the base or updates repo. This includes the centosplus kernels.
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.
- Ensure your CentOS yum or dnf configuration is working; that is, there are no stale repositories.
- Disable all non-CentOS repositories. You can re-enable the repositories after the switch.
- Ensure you have at least 5GB of free space in
/var/cache
. - Disable all automatic updates; for example,
via yum-cron
.
Obtain the Script
With your system prepared, can now obtain the centos2ol.sh
script from Github.
curl
to download it:
- Login to your CentOS Linux 6, 7 or 8 instance as a
user with
sudo
privileges. - Enter the
command:
$ curl -O https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
The system responds:% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10747 100 10747 0 0 31241 0 --:--:-- --:--:-- --:--:-- 31241
Run the Script
To complete the switch from CentOS to Oracle Linux, now run the script:
$ sudo bash centos2ol.sh
-r | Reinstalls 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. |
-k | Do not install the UEK kernel and disable UEK repos This option will not install the UEK kernel and will disable all UEK yum repositories. |
-V | Verify RPM information before and after the switch This option creates
four output files in /var/tmp/ :
|
After you've run the script, test it on a Dev or test environment before running it on your production environment.
Enable Debugging
You can enable debugging by using this command:
sudo bash -x centos2ol.sh
This will switch your CentOS instance to Oracle Linux in debug mode. In debug mode, Oracle Linux will print a trace of commands and their arguments or associated word lists after they are expanded but before they are executed.