Upgrade OS: CentOS 7 to Rocky Linux 8#
Caution
There is no official upgrade path from CentOS 7 to CentOS 8 or Rocky Linux.
Instructions here are provided here on a best effort basis, and without warranty. Back up your data before attempting an upgrade.
This section provides instructions on how to upgrade CentOS 7 to Rocky Linux 8.
Requirements#
Familiarity with the terminal
Root access to the CentOS 7 host.
Manually upgrade CentOS 7 to CentOS 8#
Important
Back up your data. Run at your own risk. There is no official upgrade path from CentOS 7 to CentOS 8. Instructions here are provided here on a best effort basis, and without warranty.
To upgrade a CentOS 7 host to CentOS 8, run as root:
Make sure CentOS 7 is up-to-date:
yum update -y
Remove old kernel packages:
sudo package-cleanup -y --oldkernels --count=1
Reboot:
reboot
Migrate to Rocky Linux using Leapp#
Run the following with root privileges:
Install Leapp:
yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el7.noarch.rpm yum install -y leapp-upgrade leapp-data-rocky
Disable root login via SSH:
Warning
This disables logging with
root
user via SSH. Ensure you have access to the server through a user other thanroot
before continuing.echo PermitRootLogin no | tee -a /etc/ssh/sshd_config
Generate the Leapp
answerfile
:Generate the initial answerfile:
leapp preupgrade
Remediate inhibitors raised by
preupgrade
.leapp answer --section remove_pam_pkcs11_module_check.confirm=True
Remediate other inhibitors raised by
preupgrade
. These are usually found in/var/log/leapp/leapp-report.txt
.You can run
leap answer --section=<section>
to address individual inhibitors.Run
preupgrade
to make sure that all inhibitors have been addressed.
Once all
preupgrade
inhibitors have been addressed, run theupgrade
command to start migrating from CentOS to Rocky Linux:leapp upgrade
Once the upgrade completes, clean any dangling packages and reboot:
dnf clean packages -y reboot
Tip
Once your system has started up again, you can check the current OS version it is running with:
cat /etc/os-release