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
rootuser via SSH. Ensure you have access to the server through a user other thanrootbefore continuing.echo PermitRootLogin no | tee -a /etc/ssh/sshd_config
Generate the Leapp
answerfile:Generate the initial answerfile:
leapp preupgradeRemediate 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
preupgradeto make sure that all inhibitors have been addressed.
Once all
preupgradeinhibitors have been addressed, run theupgradecommand to start migrating from CentOS to Rocky Linux:leapp upgradeOnce 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