This repository contains a set of Bash scripts to facilitate the upgrade of CentOS 8 Stream to CentOS 9 Stream in a structured and controlled manner. Since an in-place upgrade is not officially supported, this method is designed to minimize risk by breaking the process into three distinct stages, ensuring stability at each step.
The upgrade process is divided into three stages, each executed separately, allowing manual verification and reboots between steps:
- Updates all CentOS 8 Stream packages.
- Disables incompatible modules.
- Instructs the user to reboot the system.
- Installs the necessary CentOS 9 Stream repositories.
- Synchronizes all installed packages to CentOS 9 Stream.
- Rebuilds the RPM database.
- Checks and installs the latest kernel if needed.
- Instructs the user to reboot the system.
- Verifies that CentOS 9 Stream is installed.
- Ensures the latest kernel is set as the default.
- Regenerates GRUB configuration.
- Removes outdated kernels.
git clone <your-github-repo-url>
cd <repository-name>chmod +x centos8to9_stage1_prep.sh
sudo ./centos8to9_stage1_prep.sh- After completion, reboot the system manually:
sudo reboot
chmod +x centos8to9_stage2_upgrade.sh
sudo ./centos8to9_stage2_upgrade.sh- After completion, reboot the system manually:
sudo reboot
chmod +x centos8to9_stage3_cleanup.sh
sudo ./centos8to9_stage3_cleanup.shAfter completing all three stages, confirm the upgrade was successful:
cat /etc/centos-releaseIt should output something like:
CentOS Stream release 9
Check the kernel version:
uname -rEnsure all services are functioning as expected and address any missing dependencies that may arise due to the upgrade.
- Missing or broken dependencies?
sudo dnf distro-sync -y
- Old packages causing issues?
sudo dnf autoremove -y
- Network issues preventing repository installation? Ensure you have a working internet connection and can reach the CentOS mirrors.
This project is provided under the MIT License. Use at your own risk, and contributions are welcome!