The following steps will migrate a CentOS7 server to CentOS8.
yum -y install epel-release
yum -y install yum-utils rpmconf
rpmconf -a # 5 times N
rm -rf /etc/yum.repos.d/reece.repo
yum clean all
package-cleanup --orphans | egrep 'noarch|x86_64' | xargs -r -n 1 yum -y remove
package-cleanup --leaves | egrep 'noarch|x86_64' | xargs -r -n 1 yum -y remove
# do above until none found - leaves 4-5 times
yum install -y dnf
dnf remove -y yum yum-metadata-parser
rm -Rf /etc/yum
dnf -y upgrade
cd /etc/yum.repos.d && mkdir backups && mv CentOS-* backups
tee CentOS-Linux-BaseOS.repo<<EOM
[baseos]
name=CentOS Linux \$releasever - BaseOS
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm- gpg/RPM-GPG-KEY-centosofficial
EOM
tee CentOS-Linux-AppStream.repo<< EOM
[appstream]
name=CentOS Linux \$releasever - AppStream
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm- gpg/RPM-GPG-KEY-centosofficial
EOM
rpm -e `rpm -q kernel` --nodeps
rpm -e `rpm -q kernel-devel` --nodeps
rpm -e --nodeps sysvinit-tools
dnf -y erase dracut-network python36-rpmconf python-syspurpose python-sssdconfig
dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
dnf -y install kernel-core
dnf -y groupupdate "Core" "Minimal Install"
grub2-mkconfig -o /boot/grub2/grub.cfg
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
systemctl reboot
That's it, after the reboot the server should be running CentOS8.
Comments
Post a Comment