centos2ol
centos2ol copied to clipboard
Migration from CentOS 7 creates wrong Oracle repos
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.
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?