When updating CentOS or RedHat via yum its possible to receive an error similar to the below. This error will cause an issue where yum will not work even though as described below the issue is typically isolated to one yum repository.
Error:Cannot retrieve repository metadata (repomd.xml) for repository: dag. Please verify its path and try again
In the case above the issue was with the dag yum repository. There error is generic in the sense that the issue I was seeing if the fact that the server was up but that directory was either moved or was not mounted to their server properly. Yum is complaining that you need to check the path to make sure it is correct.
You have two options to resolve this yum repo issue as described below.
- Temporarily Disable Repo:You can temporarily disable the yum repository that is causing you issues by simply changing “enabled=1” to “enabled=0” as shown in the below dag.repo file.
Disabled Yum Repository:- name=Dag RPM Repository for Red Hat Enterprise Linux
- baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
- gpgcheck=1
- gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
- enabled=o
- Use a Different Repo Mirror:The second option is to modify the baseurl variable in the .repo file with the issue. Repository files are located in /etc/yum.repos.d/. Below I commented out the problem baseurl and added a new one.
Modify Repo BaseURL:- name=Dag RPM Repository for Red Hat Enterprise Linux
- #baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
- baseurl=http://dag.linux.iastate.edu/dag/redhat/el5/en/$basearch/dag
- gpgcheck=1
- gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
- enabled=1
Once you have either disabled or changed the baseurl variable yum should run without issue. If there is still an error with another yum repository you can resolve that issue as well though its fairly unlikely that two repositories would have errors at the same time so you should investigate issues on your server or with your network connection.
You are an absolute savior! Thank You!
Hello Justin,
Thanks for taking the time to leave feedback. Glad the Yum info helped you out.
Thanks.
alex
i changed enable=1 to enable=0 and then yum list worked.after that, i changed back enable=1 and same error appear.
Hello su su,
That is because when you change “enabled” to 0 you are disabling the repo which no longer attempts to contact that yum repo URL. You get the error again when you enable it.
Thanks.
alex
Thanks for that one. It was very helpful.
Hello Jorge,
No problem. Thanks for taking the time to leave feedback.
Thanks.
alex