Thursday, February 9, 2012

Yum cannot resolve $releasever - Fedora

Yesterday I was installing some packages with yum, but then later decided to cancel the install pressing Ctrl+C, after that i started noticing this issue. Whenever i tried to install anything yum spilled the following error.

Could not parse metalink http://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=x86_64 error was
No repomd file

Yum was not able to resolve the value of $releasever variable. It turns out that it gets to know that value from the version of "fedora-release" package installed on the system.
After i figured that out, the solution was simple, just reinstall "fedora-release" for your current system. Since currently i am using fedora 15, I issued the following command

yum install fedora-release --releasever=15

Notice, you need to tell yum to use release version of the current fedora release using --releasever