As you all know CentOS 8 is EOL at December 31st 2021. If you have installed CentOS 8 you need to do something before this date. As we see we you have the following options:
- Do nothing and wait
This isn't really an option. At December 31 2021 you will not get any updates anymore. Security wise this is really an issue. Bugs won't be fixed which, in worst case, can result in hackers taking over your machine and you lose your data or your data will be made publicly available. Installing additional stuff will also be problematic at one point. - Reinstall your server (or install a new one and migrate everything) with an OS of your choice.
This is the right choice if you want to get rid of the RPM (read Red Hat) based systems. Migrating to another non-RPM based distribution is not possible.
Also if you're not sure if an in-place migration to an RPM based distribution will work for you, you can reinstall it with another OS of your choice. This way it's also possible to install a server next to the current one and do a migration of your application/data. This way you start fresh again. - Do an in-place migration to CentOS Stream
CentOS stream is the "new" CentOS. The main difference is that it isn't a 1:1 copy of RHEL anymore but is running just ahead of RHEL. This means before development is coming to RHEL it will come to CentOS stream. The advantage is you don't have to wait anymore for new features coming to CentOS after the are added to RHEL. The disadvantage is that it's not that well tested as for RHEL. - Do an in-place migration to AlmaLinux
AlmaLinux is a 1:1 copy of RHEL. After the announcement that CentOS 8 will be End-of-life the company CloudLinux took action and started creating an alternative for CentOS. At March 30 2021 they were able to release a production ready distribution as replacement for CentOS.
AlmaLinux is using the source of RHEL and will therefor run behind RHEL itself. This brings the advantage that every feature is tested in RHEL and AlmaLinux is as stable as RHEL is. The disadvantage is that features come later to AlmaLinux than in RHEL or CentOS Stream. How much later we have to experience - Do an in-place migration to Rocky Linux
Rocky Linux is a 1:1 copy of RHEL. After the announcement that CentOS 8 will be End-of-life one of the original creators of CentOS took action and started gathering people to build an alternative for CentOS. At the time of writing there is no production ready distribution available.
Rocky Linux is using the source of RHEL and will therefor run behind RHEL itself. This brings the advantage that every feature is tested in RHEL and Rocky Linux is as stable as RHEL is. The disadvantage is that features come later to Rocky Linux than in RHEL or CentOS Stream. How much later we have to experience
What should you do? That's up to you. If you consider an in-place migration we will show you how this can be done in the rest of this article.
In-place migrations are not without risk. Before starting a migration in production make sure everything is tested upfront and make sure you have a snapshot or backup of the current situation! |
the output of the screens is per situation different and can be different for everybody. The result nevertheless should be the same
Preparation
No matter what migration you choose we first have to make sure our system is up-to-date with the latest updates. This can be achieved by running dnf update
[user@vps-0-ledced ~]$ sudo dnf update [sudo] password for user: Last metadata expiration check: 0:00:11 ago on Thu 01 Apr 2021 07:18:14 PM CEST. Dependencies resolved. ========================================================================================================================= Package Architecture Version Repository Size ========================================================================================================================= Installing: centos-linux-release noarch 8.3-1.2011.el8 BaseOS 22 k replacing centos-release.x86_64 8.2-2.2004.0.2.el8 replacing centos-repos.x86_64 8.2-2.2004.0.2.el8 kernel x86_64 4.18.0-240.15.1.el8_3 BaseOS 4.3 M kernel-core x86_64 4.18.0-240.15.1.el8_3 BaseOS 30 M kernel-modules x86_64 4.18.0-240.15.1.el8_3 BaseOS 26 M Upgrading: NetworkManager x86_64 1:1.26.0-12.el8_3 BaseOS 2.4 M NetworkManager-libnm x86_64 1:1.26.0-12.el8_3 BaseOS 1.8 M NetworkManager-tui x86_64 1:1.26.0-12.el8_3 BaseOS 320 k ... wget x86_64 1.19.5-10.el8 AppStream 734 k xfsprogs x86_64 5.0.0-4.el8 BaseOS 1.1 M yum noarch 4.2.23-4.el8 BaseOS 192 k Installing dependencies: centos-linux-repos noarch 8-2.el8 BaseOS 20 k grub2-tools-efi x86_64 1:2.02-90.el8_3.1 BaseOS 471 k libmodulemd x86_64 2.9.4-2.el8 BaseOS 189 k Installing weak dependencies: crypto-policies-scripts noarch 20200713-1.git51d1222.el8 BaseOS 67 k gnupg2-smime x86_64 2.2.20-2.el8 BaseOS 283 k kpartx x86_64 0.8.4-5.el8 BaseOS 108 k memstrack x86_64 0.1.11-1.el8 BaseOS 48 k Transaction Summary ========================================================================================================================= Install 11 Packages Upgrade 193 Packages Total download size: 292 M Is this ok [y/N]: y Downloading Packages: (1/204): centos-linux-release-8.3-1.2011.el8.noarch.rpm 2.1 MB/s | 22 kB 00:00 (2/204): centos-linux-repos-8-2.el8.noarch.rpm 1.9 MB/s | 20 kB 00:00 (3/204): crypto-policies-scripts-20200713-1.git51d1222.el8.noarch.rpm 5.8 MB/s | 67 kB 00:00 (4/204): gnupg2-smime-2.2.20-2.el8.x86_64.rpm 33 MB/s | 283 kB 00:00 (5/204): grub2-tools-efi-2.02-90.el8_3.1.x86_64.rpm 33 MB/s | 471 kB 00:00 (6/204): kernel-4.18.0-240.15.1.el8_3.x86_64.rpm 53 MB/s | 4.3 MB 00:00 ... (200/204): vim-minimal-8.0.1763-15.el8.x86_64.rpm 37 MB/s | 572 kB 00:00 (201/204): xfsprogs-5.0.0-4.el8.x86_64.rpm 43 MB/s | 1.1 MB 00:00 (202/204): util-linux-2.32.1-24.el8.x86_64.rpm 35 MB/s | 2.5 MB 00:00 (203/204): yum-4.2.23-4.el8.noarch.rpm 11 MB/s | 192 kB 00:00 (204/204): linux-firmware-20200619-101.git3890db36.el8_3.noarch.rpm 39 MB/s | 101 MB 00:02 ------------------------------------------------------------------------------------------------------------------------- Total 40 MB/s | 292 MB 00:07 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Running scriptlet: filesystem-3.8-3.el8.x86_64 1/1 Preparing : 1/1 Running scriptlet: libgcc-8.3.1-5.1.el8.x86_64 1/1 Upgrading : libgcc-8.3.1-5.1.el8.x86_64 1/399 Running scriptlet: libgcc-8.3.1-5.1.el8.x86_64 1/399 Upgrading : python3-setuptools-wheel-39.2.0-6.el8.noarch 2/399 Upgrading : python3-pip-wheel-9.0.3-18.el8.noarch 3/399 Upgrading : tzdata-2021a-1.el8.noarch 4/399 ... vim-minimal-2:8.0.1763-15.el8.x86_64 wget-1.19.5-10.el8.x86_64 xfsprogs-5.0.0-4.el8.x86_64 yum-4.2.23-4.el8.noarch Installed: centos-linux-release-8.3-1.2011.el8.noarch centos-linux-repos-8-2.el8.noarch crypto-policies-scripts-20200713-1.git51d1222.el8.noarch gnupg2-smime-2.2.20-2.el8.x86_64 grub2-tools-efi-1:2.02-90.el8_3.1.x86_64 kernel-4.18.0-240.15.1.el8_3.x86_64 kernel-core-4.18.0-240.15.1.el8_3.x86_64 kernel-modules-4.18.0-240.15.1.el8_3.x86_64 kpartx-0.8.4-5.el8.x86_64 libmodulemd-2.9.4-2.el8.x86_64 memstrack-0.1.11-1.el8.x86_64 Complete!
In our case the kernel is updated we have to reboot the machine. You can check if a reboot is needed by installing yum-utils and run needs-restarting. No results means no reboot is neccessary. Otherwise you have to reboot.
[user@vps-0-ledced ~]$ sudo needs-restarting 1 : /usr/lib/systemd/systemd --system --deserialize 21 520 : /usr/lib/systemd/systemd-journald 584 : /sbin/auditd ... 1207 : -bash 1291 : /usr/sbin/crond -n
When this step is finished we can continue
In-place migration to CentOS Stream
CentOS created a a simple way to switch from CentOS to CentOS Stream. With 2 commands we can switch (as CentOS is calling it) to CentOS Stream.
As mentioned before. Make sure you have a snapshot or backup of the machine!!
If the preparation is done we need to "swap" the distribution from CentOS to CentOS Stream
[user@vps-0-ledced ~]$ sudo dnf swap centos-linux-repos centos-stream-repos [sudo] password for user: Last metadata expiration check: 0:12:34 ago on Thu 01 Apr 2021 07:58:57 PM CEST. Dependencies resolved. ========================================================================================================================= Package Architecture Version Repository Size ========================================================================================================================= Installing: centos-stream-repos noarch 8-2.el8 extras 19 k Removing: centos-linux-repos noarch 8-2.el8 @BaseOS 26 k Transaction Summary ========================================================================================================================= Install 1 Package Remove 1 Package Total download size: 19 k Is this ok [y/N]: y Downloading Packages: centos-stream-repos-8-2.el8.noarch.rpm 774 kB/s | 19 kB 00:00 ------------------------------------------------------------------------------------------------------------------------- Total 16 kB/s | 19 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : centos-stream-repos-8-2.el8.noarch 1/2 Erasing : centos-linux-repos-8-2.el8.noarch 2/2 Verifying : centos-stream-repos-8-2.el8.noarch 1/2 Verifying : centos-linux-repos-8-2.el8.noarch 2/2 Installed: centos-stream-repos-8-2.el8.noarch Removed: centos-linux-repos-8-2.el8.noarch Complete!
Next we have to sync the distro
[user@vps-0-ledced ~]$ sudo dnf distro-sync CentOS Stream 8 - AppStream 6.6 MB/s | 6.7 MB 00:01 CentOS Stream 8 - BaseOS 23 MB/s | 2.3 MB 00:00 CentOS Stream 8 - Extras 29 kB/s | 8.9 kB 00:00 Dependencies resolved. ========================================================================================================================= Package Architecture Version Repository Size ========================================================================================================================= Installing: centos-stream-release noarch 8.4-1.el8 baseos 21 k replacing centos-linux-release.noarch 8.3-1.2011.el8 kernel x86_64 4.18.0-294.el8 baseos 5.8 M kernel-core x86_64 4.18.0-294.el8 baseos 36 M kernel-modules x86_64 4.18.0-294.el8 baseos 28 M Upgrading: NetworkManager x86_64 1:1.30.0-2.el8 baseos 2.6 M NetworkManager-libnm x86_64 1:1.30.0-2.el8 baseos 1.8 M NetworkManager-tui x86_64 1:1.30.0-2.el8 baseos 326 k ... xfsprogs x86_64 5.0.0-8.el8 baseos 1.1 M yum noarch 4.4.2-11.el8 baseos 198 k zlib x86_64 1.2.11-17.el8 baseos 102 k Installing dependencies: hwdata noarch 0.314-8.8.el8 baseos 1.7 M libibverbs x86_64 32.0-4.el8 baseos 321 k lmdb-libs x86_64 0.9.24-1.el8 baseos 58 k pciutils x86_64 3.7.0-1.el8 baseos 105 k rdma-core x86_64 32.0-4.el8 baseos 59 k tpm2-tss x86_64 2.3.2-3.el8 baseos 275 k Transaction Summary ========================================================================================================================= Install 10 Packages Upgrade 169 Packages Total download size: 309 M Is this ok [y/N]: y Downloading Packages: (1/179): centos-stream-release-8.4-1.el8.noarch.rpm 2.2 MB/s | 21 kB 00:00 (2/179): hwdata-0.314-8.8.el8.noarch.rpm 23 MB/s | 1.7 MB 00:00 (3/179): kernel-4.18.0-294.el8.x86_64.rpm 41 MB/s | 5.8 MB 00:00 (4/179): libibverbs-32.0-4.el8.x86_64.rpm 37 MB/s | 321 kB 00:00 (5/179): lmdb-libs-0.9.24-1.el8.x86_64.rpm 17 MB/s | 58 kB 00:00 (6/179): pciutils-3.7.0-1.el8.x86_64.rpm 19 MB/s | 105 kB 00:00 (7/179): rdma-core-32.0-4.el8.x86_64.rpm 21 MB/s | 59 kB 00:00 ... unbound-libs-1.7.3-15.el8.x86_64 util-linux-2.32.1-27.el8.x86_64 xfsprogs-5.0.0-8.el8.x86_64 yum-4.4.2-11.el8.noarch zlib-1.2.11-17.el8.x86_64 Installed: centos-stream-release-8.4-1.el8.noarch hwdata-0.314-8.8.el8.noarch kernel-4.18.0-294.el8.x86_64 kernel-core-4.18.0-294.el8.x86_64 kernel-modules-4.18.0-294.el8.x86_64 libibverbs-32.0-4.el8.x86_64 lmdb-libs-0.9.24-1.el8.x86_64 pciutils-3.7.0-1.el8.x86_64 rdma-core-32.0-4.el8.x86_64 tpm2-tss-2.3.2-3.el8.x86_64 Complete!
That's it. It only needs a final reboot and you can start testing your applications.
More information about this procedure can be found on: https://www.centos.org/centos-stream/#converting-from-centos-linux-to-centos-stream
In-place migration to AlmaLinux
AlmaLinux provided a tool to migrate any EL to AlmaLinux. This is for some distributions still work in progress but migrating CentOS to AlmaLinux is covered.
When the preparation is done we are ready to start the migration.
As mentioned before. Make sure you have a snapshot or backup of the machine!!
We need to download a script from the AlmaLinux github pages and run it
[user@vps-0-ledced ~]$ curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 12323 100 12323 0 0 68461 0 --:--:-- --:--:-- --:--:-- 68843 [user@vps-0-ledced ~]$ sudo bash almalinux-deploy.sh [sudo] password for user: Check root privileges OK Check Secure Boot disabled OK Check centos-8.x86_64 is supported OK Download RPM-GPG-KEY-AlmaLinux OK Import RPM-GPG-KEY-AlmaLinux to RPM DB OK Download almalinux-release package OK Verify almalinux-release package OK Remove centos-linux-release package OK Remove centos-gpg-keys package OK Remove centos-linux-repos package OK Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:almalinux-release-8.3-4.el8 ################################# [100%] Install almalinux-release package OK ... which-2.21-12.el8.x86_64 xfsprogs-5.0.0-4.el8.x86_64 xkeyboard-config-2.28-1.el8.noarch xz-5.2.4-3.el8.x86_64 xz-libs-5.2.4-3.el8.x86_64 yum-4.2.23-4.el8.noarch yum-utils-4.0.17-5.el8.noarch zlib-1.2.11-16.el8_2.x86_64 Complete! Run dnf distro-sync -y OK
When the script is finished and no errors occurred we can check the results
[user@vps-0-ledced ~]$ cat /etc/redhat-release AlmaLinux release 8.3 (Purple Manul) [user@vps-0-ledced ~]$ [user@vps-0-ledced ~]$ sudo grubby --info DEFAULT | grep AlmaLinux [sudo] password for user: title="AlmaLinux (4.18.0-240.15.1.el8_3.x86_64) 8.3 (Purple Manul)"
That's it. It only needs a final reboot and you can start testing your applications.
More information about the script and process can be found on: https://github.com/AlmaLinux/almalinux-deploy
In-place migration to Rocky Linux
At the time of writing this document there is no stable version released yet of Rocky Linux. When it becomes available we will update this document with the right instructions
Comments
Please sign in to leave a comment.