Skip to content

Instantly share code, notes, and snippets.

@yodermk
Created February 13, 2022 19:08
Show Gist options
  • Star 25 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save yodermk/9c8081a70ec4e0f2ffca8d6c3603da32 to your computer and use it in GitHub Desktop.
Save yodermk/9c8081a70ec4e0f2ffca8d6c3603da32 to your computer and use it in GitHub Desktop.
Commands to live-upgrade CentOS Streams 8 -> 9
# The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/
#
# It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here.
yum upgrade
reboot
dnf install epel-release
dnf install rpmconf
dnf install yum-utils
rpmconf -a # answer "n" to both things
package-cleanup --leaves
package-cleanup --orphans
dnf install http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-9.el9.noarch.rpm http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-9.el9.noarch.rpm http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-9.el9.noarch.rpm
curl -O https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
curl -O https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
rpm -Uvh *.rpm
yum update
dnf clean all
rpm -e `rpm -q kernel`
dnf -y --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync
dnf clean all
reboot
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
dnf -y groupupdate "Core" "Minimal Install"
@mcgru
Copy link

mcgru commented May 17, 2023

why 3 lines instead of one?
dnf install epel-release rpmconf yum-utils

@hezd1
Copy link

hezd1 commented Aug 8, 2023

how is this second hit on google? dont do dis guys

@RaineKos
Copy link

RaineKos commented Jan 7, 2024

In my case this left me without a grub entry pointing to a working kernel so after the reboot grub2 failed to find a working kernel. I was able to boot off a centos iso and rescue the system to get it mounted. Then installed the iso's kernel rpm into the mounted root. Then chroot to the mounted root and performed a grub2-mkconfig. That got me a working kernel and config. Once that was all done the reboot bought me back into a working system where these steps finished cleanly. So maybe before the reboot there should be an attempt to dnf install kernel? then a grub2-mkconfig to ensure grub's configs are updated to target that new kernel.

@electroms
Copy link

Thanks, It's not exactly the configuration I used but it was interresting.
If i can i will commit a Fork wen I will finished my configuration :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment