Fix for yum Error: Cannot retrieve repository metadata for repository
Can’t install new rpms using yum? Update won’t work? Chances are if you’re seeing the error message below, the repository files are not the problem.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again
It may be something easily overlooked – the dns resolver!
Check /etc/resolv.conf and make sure your dhcp server is supplying at least one line starting with “nameserver”. If your system uses dhclient, then /etc/resolv.conf should look something like this:
; generated by /sbin/dhclient-script
search domain.com
nameserver 192.168.0.1
nameserver 192.168.1.1
If that fixes it, the problem was in converting the host names in the repository files under /etc/yum.repos.d/ into IP addresses.