I was trying to use yum on a Centos 7 cluster to install a package, and I was getting the following error:
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this: [...]
I tried several suggested solutions online (yum clean all
; deleting the cache; deleting the repo-databases and rebuilding, etc.) and nothing worked.
After hours of troubleshooting, I managed to find a workaround. On the /etc/yum.repos.d/CentOS-Base.repo
file, I uncommented the baseurl
line and replaced the $releasever
variable with "7" (i.e. the version of the OS). For some reason, yum could not recognize $releasever and could not find the repo.
So instead of:
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
I have:
baseurl=http://mirror.centos.org/centos/7/os/$basearch/
after which both yum update and yum install seem to work fine. However, I don't know if this is a permanent solution to the issue.
Can someone tell me what's going on and if there's a more proper way to fix this problem?
Thanks.
rpm -q --qf "%{VERSION}\n" --whatprovides redhat-release