oracle / centos2ol

Script and documentation to switch CentOS/Rocky Linux to Oracle Linux
https://linux.oracle.com/switch/centos/
Universal Permissive License v1.0
345 stars 83 forks source link

An error occurred while attempting to switch this system to Oracle Linux #126

Closed shaneholloman closed 2 years ago

shaneholloman commented 2 years ago

Looking inside the script I made an attempt to understand at which point the script wanted to exit, but I failed.

I was hoping this info & log would be helpful to the devs here to share some possibilities as to what "An error occurred..." that would cause this break at this point in the script.

I have run this wonderful script successfully on many very different VMs

about vm

[ansible@zabbix-proxy1 ~]$ cat /etc/*-release
CentOS Linux release 8.5.2111
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
CentOS Linux release 8.5.2111
[ansible@zabbix-proxy1 ~]$

script run

[root@zabbix-proxy1 ansible]# chmod +x centos2ol.sh
[root@zabbix-proxy1 ansible]# bash centos2ol.sh -V
Checking for required packages...
Checking your distribution...
Creating a list of RPMs installed before the switch
Verifying RPMs installed before the switch against RPM database
package epel-release is not installed
Checking for yum lock...
Checking for required python packages...
Identifying dnf modules that are enabled
Finding your repository directory...
Learning which repositories are enabled...
Repositories enabled before update include:
appstream
baseos
extras
atomic
ol8_baseos_latest
ol8_appstream
ol8_UEKR6
Looking for yumdownloader...
Backing up and removing old repository files...
An error occurred while attempting to switch this system to Oracle Linux and it may be in an unstable/unbootable state. To avoid further issues, the script has terminated.
[root@zabbix-proxy1 ansible]#
Djelibeybi commented 2 years ago

Do you have the list of RPMs installed prior to the attempt? Can you add -x to the set -e line so we can get a more verbose output too?

shaneholloman commented 2 years ago

@Djelibeybi Avi set -x was the ticket to find the issue! Awesome mate.

Turns out in my case

[root@zabbix-proxy1 ansible]# rpm -q --whatprovides /etc/redhat-release
centos-linux-release-8.3-1.2011.el8.noarch
centos-linux-release-8.4-1.2105.el8.noarch

So I dnf remove centos-linux-release-8.3-1.2011.el8.noarch

And the script happily went on it's merry way

Djelibeybi commented 2 years ago

Huzzah! It's weird that you managed to get two centos-linux-release packages installed, but given one was from 2011, I guess the reason is lost to history. I'm going to close this issue, but feel free to open a new one if anything else occurs.

shaneholloman commented 2 years ago

BTW, since centos8 repos have move to vault I also

Change to following line to each respective file:

[root@etp-monitor1 ansible]# vi /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
[root@etp-monitor1 ansible]# vi /etc/yum.repos.d/CentOS-Linux-AppStream.repo

CentOS-Linux-BaseOS.repo baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/\ CentOS-Linux-AppStream.repo baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/

Comment the mirrors

Djelibeybi commented 2 years ago

Oh, good point. Let me fix that up.