Upgrade OS: CentOS 7 to Rocky Linux 8#
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.
Familiarity with the terminal
Root access to the CentOS 7 host.
Manually upgrade CentOS 7 to CentOS 8#
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
Migrate to Rocky Linux using Leapp#
Run the following with root privileges:
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:
This disables logging with
rootuser via SSH. Ensure you have access to the server through a user other than
echo PermitRootLogin no | tee -a /etc/ssh/sshd_config
Generate the Leapp
Generate the initial answerfile:
Remediate inhibitors raised by
leapp answer --section remove_pam_pkcs11_module_check.confirm=True
Remediate other inhibitors raised by
preupgrade. These are usually found in
You can run
leap answer --section=<section>to address individual inhibitors.
preupgradeto make sure that all inhibitors have been addressed.
preupgradeinhibitors have been addressed, run the
upgradecommand to start migrating from CentOS to Rocky Linux:
Once the upgrade completes, clean any dangling packages and reboot:
dnf clean packages -y reboot
Once your system has started up again, you can check the current OS version it is running with: