Table of Contents
As you know, CentOS Linux 8 became the end of life on 31 Dec 2021. It will now continue its life as CentOS Stream 8. Many people/organizations using CentOS are migrating to different distributions. Rocky Linux is one of these distributions. After CentOS became the end of life, this community-released distribution seems to have replaced CentOS.
Of course, Rocky Linux can be installed on systems to be installed for the first time, but how can we move old systems to Rocky Linux? How do we switch from CentOS 8 to Rocky Linux?
How to upgrade CentOS 8 to Rocky Linux?
The Rocky Linux team has prepared a script for the upgrade from CentOS to Rocky Linux. By downloading and running this script, you can upgrade from CentOS 8 to Rocky Linux. You can get this script with 2 different methods.
First, you can install git package and pull script in git repository. The second method is with cURL, you can just pull the script and then run it.
Let's take a look at the features of the system before upgrading:
[foc@centos8 ~]$ hostnamectl Static hostname: centos8 Icon name: computer-vm Chassis: vm Machine ID: e965f8895bc44256abc749a36aea7f45 Boot ID: dbc7f2a31f7b4ba6a141f4435e232d2e Virtualization: kvm Operating System: CentOS Stream 8 CPE OS Name: cpe:/o:centos:centos:8 Kernel: Linux 4.18.0-408.el8.x86_64 Architecture: x86-64
Method-1: Download the script from git
Install the git package to pull the git repo:
[foc@centos8 ~]$ sudo dnf install git -y
Then clone the repo:
[foc@centos8 ~]$ git clone https://github.com/rocky-linux/rocky-tools.git
Change to the directory where the script is located:
[foc@centos8 ~]$ cd rocky-tools/migrate2rocky
Give the script execute permission
[foc@centos8 rocky-tools]$ sudo chmod +x migrate2rocky.sh
And run the script, sit back:
[foc@centos8 rocky-tools]$ sudo ./migrate2rocky.sh -r
Method-2: Download the script with cURL
If your system does not have cURL, install it with the following command:
[foc@centos8 rocky-tools]$ sudo dnf install curl -y
Then pull the upgrade script:
[foc@centos8 ~]$ curl https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh -o migrate2rocky.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--100 44912 100 44912 0 0 85060 0 --:--:-- --:--:-- --:--:-- 84899
Give the upgrade script execute permission:
[foc@centos8 ~]$ chmod u+x migrate2rocky.sh
And the script is run:
[foc@centos8 ~]$ sudo ./migrate2rocky.sh -r migrate2rocky - Begin logging at Sun 08 Jan 2023 15:12:01 EST. Removing dnf cache Preparing to migrate CentOS Stream 8 to Rocky Linux 8. Determining repository names for CentOS Stream 8. ..... Found the following repositories which map from CentOS Stream 8 to Rocky Linux 8: CentOS Stream 8 Rocky Linux 8 appstream appstream baseos baseos extras extras Getting system package names for CentOS Stream 8.......... Found the following system packages which map from CentOS Stream 8 to Rocky Linux 8: CentOS Stream 8 Rocky Linux 8 centos-logos-ipa rocky-logos-ipa ...
You can follow the processes done during the upgrade on the screen.
... Installed: grub2-tools-efi-1:2.02-142.el8.rocky.0.2.x86_64 kernel-4.18.0-425.3.1.el8.x86_64 kernel-core-4.18.0-425.3.1.el8.x86_64 kernel-modules-4.18.0-425.3.1.el8.x86_64 Complete! Last metadata expiration check: 0:05:45 ago on Sun Jan 8 15:14:21 2023. Dependencies resolved. Nothing to do. Complete! CentOS Stream Migration Notes: Because CentOS Stream leads RockyLinux by the next point release many packages in Stream will have higher version numbers than those in RockyLinux, some will even be rebased to a new upstream version. Downgrading these packages to the versions in RockyLinux carries the risk that the older version may not recognize config files, data or other files generated by the newer version in Stream. To avoid issues with this the newer package versions from CentOS Stream have been retained. Also the CentOS Stream repositories have been retained but renamed with a prefix of "stream-" to avoid clashing with RockyLinux repositories, but these same repos have also been disabled so that future package installs will come from the stock RockyLinux repositories. If you do nothing except update to the next point release of RockyLinux when it becomes available then the packages retained from Stream should be replaced at that time. If you need to update a package from Stream (eg: to fix a bug or security issue) then you will need to enable the appropriate repository to do so. Done, please reboot your system. A log of this installation can be found at /var/log/migrate2rocky.log ...
Upgrade completed. Reboot the system:
[foc@centos8 ~]$ sudo reboot
You can see Rocky Linux in the grub menu.
Now let's check the system information:
[foc@centos8 ~]$ hostnamectl Static hostname: centos8 Icon name: computer-vm Chassis: vm Machine ID: e965f8895bc44256abc749a36aea7f45 Boot ID: 509e56690044483da477564592dff946 Virtualization: kvm Operating System: Rocky Linux 8.7 (Green Obsidian) CPE OS Name: cpe:/o:rocky:rocky:8:GA Kernel: Linux 4.18.0-425.3.1.el8.x86_64 Architecture: x86-64
You can see the Operating System as "Rocky Linux 8.7 (Green Obsidian)".
The upgrade script has a few simple parameters. You can use the -h parameter to view it.
[foc@centos8 rocky-tools]$ sudo ./migrate2rocky/migrate2rocky.sh -h migrate2rocky - Begin logging at Sun 08 Jan 2023 15:28:45 EST. Usage: migrate2rocky.sh [OPTIONS] Options: -h Display this help -r Convert to rocky -V Verify switch !! USE WITH CAUTION !!
Although the upgrade process may seem simple, it should be done carefully. Systems running on the operating system should be checked and data redundancy should be ensured. Perhaps most importantly, snapshots should be taken if possible.
docs.rockylinux.org - How to Migrate to Rocky Linux from CentOS