Skip to content

Instantly share code, notes, and snippets.

@yodermk
Created February 13, 2022 19:08
Show Gist options
  • 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"
@idc77
Copy link

idc77 commented Feb 11, 2023

What to do about
warning: Signature not supported. Hash algorithm SHA1 not available.

A Google search leads to https://www.redhat.com/en/blog/rhel-security-sha-1-package-signatures-distrusted-rhel-9
but that doesn't solve anything

Nevermind.. after removing the old kernel, despite the new kernel being installed, the system hangs at grub.
Just once I'd like to use something professionals create.

@oqolopo
Copy link

oqolopo commented Feb 13, 2023

You can remove the modules by deleting their metadata files from /etc/dnf/modules.d/

The simplest method.

@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