Skip to content

Instantly share code, notes, and snippets.

@publicarray
Forked from yodermk/centos8-9.sh
Last active April 21, 2023 01:04
Show Gist options
  • Save publicarray/cdc46bc9593528cd641ad5a8b24092d5 to your computer and use it in GitHub Desktop.
Save publicarray/cdc46bc9593528cd641ad5a8b24092d5 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-12.el9.noarch.rpm http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-12.el9.noarch.rpm http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-12.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
curl -O http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-release-9.0-12.el9.noarch.rpm
curl -O http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-12.el9.noarch.rpm
curl -O http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-12.el9.noarch.rpm
rpm -Uvh --force *.rpm
yum update
dnf clean all
rpm -e `rpm -q kernel`
dnf -y --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync
#dnf -y --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync swap python39-setuptools python3-setuptools
dnf clean all
reboot
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
dnf -y groupupdate "Core" "Minimal Install"
rpm -e subscription-manager
dnf remove python36
rm /etc/dnf/modules.d/python36.module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment