The annoying ‘yum Error’

One of the most annoying error that I have faced on Fedora is the yum error:

Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again

After a lot of googling and going through forums, I have made a list of solutions that can fix this problem.

-> Sometimes, you may face this error just after a fresh install. It can be fixed then by
yum clean all
yum clean metadata
yum clean dbcache

It can also be helpful even in the cases when yum was working just a few hours back and suddenly the problem rose and you have no idea why.

-> One of the most common fix is editing the fedora repo file. The fix is uncomment the baseurl line and comment the mirrorlist and then edit the /etc/hosts file adding

Well it’s is the most common fix. But, it has never helped me.

-> Another fix is disable the repo that causes this erro and then do the yum update. This was what I found in some forums but none of the solution-seekers were satisfied. One can though try this. It might be just as helpful.

-> Sometimes you may need to fix the rpm db. Type
rpm -vv –initdb
If one still gets an error, he can further do
rpm -f /var/lib/rpm/__db*
rpmdb -vv –rebuild

-> If behind a proxy, one may have forgotten to export the proxy settings. He can do so by
export HTTP_PROXY=http://username:password@IP:port
export FTP_PROXY=http://username:password@IP:port
For permanent solution to text internet, one can create a proxy.[c]sh file in /etc/profile.d/ and type
export HTTP_PROXY=http://username:password@IP:port
export FTP_PROXY=http://username:password@IP:port
export http_proxy=http://username:password@IP:port
export ftp_proxy=http://username:password@IP:port

and then log out and log in.

And for yum, add
to /etc/yum.conf and do the update.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s