oracle / centos2ol

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

Migration from CentOS 7 creates wrong Oracle repos #132

Open johndoe4567 opened 2 years ago

johndoe4567 commented 2 years ago

After running

wget https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
bash centos2ol.sh -V

and rebooting, repos in /etc/yum.repos.d/ are like so:

baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL7/latest/$basearch/

dnf makecache then fails with:

Failed to synchronize cache for repo 'ol7_developer_EPEL', ignoring this repo.
Failed to synchronize cache for repo 'ol7_optional_latest', ignoring this repo.
Failed to synchronize cache for repo 'ol7_UEKR6', ignoring this repo.
Failed to synchronize cache for repo 'ol7_latest', ignoring this repo.

Running the following:

sed -i 's/\$ociregion\.\$ocidomain/\.oracle\.com/g' /etc/yum.repos.d/*.repo

fixes the problem.

ChristianGfK commented 2 years ago

That sounds like the files /etc/yum/vars/ociregion and /etc/yum/vars/ociregion are missing? Those contain an empty line, and oracle.com, respectively, for me. That's odd. My OL7 and OL8 installs have this, but I don't know from where.

They don't appear to be from any package: rpm -qa --filesbypkg | rg ocidomain returns nothing. But with the files present, this works just fine for me.

But... I'm using yum, not dnf. Maybe that's the difference?