yum update fails: Error: Cannot retrieve repository metadata (repomd.xml) for repository …
I'm using CentOS 6.3. When I try to update my system with yum I have this message:
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.ircam.fr * centosplus: miroir.univ-paris13.fr * extras: mirrors.ircam.fr * update: centos.quelquesmots.fr http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404" Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again
yum clean all
Loaded plugins: fastestmirror Cleaning repos: CactiEZ addons base centosplus extras pgdg93 update Cleaning up Everything Cleaning up list of fastest mirrors
Loaded plugins: fastestmirror check all
yum erase apf
Loaded plugins: fastestmirror Setting up Remove Process No Match for argument: apf Determining fastest mirrors * base: centos.mirror.fr.planethoster.net * centosplus: centos.mirror.fr.planethoster.net * extras: mirrors.ircam.fr * update: centos.quelquesmots.fr CactiEZ | 2.9 kB 00:00 CactiEZ/primary_db | 13 kB 00:00 http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404" Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.fr.planethoster.net * centosplus: centos.mirror.fr.planethoster.net * extras: mirrors.ircam.fr * update: centos.quelquesmots.fr http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404" Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again
[main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=5 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release
since yesterday you asked so much question about bug with yum internet connectivity and path issues, have you just considered to reinstall your system ? It's seems pretty f$$$ed up
You need to fix the internet connectivity first. Re-installing might be an option. Or try booting a live CD system.
I solved the problem by deleting "yum.repos.d" folder and recreate an example.repo file. add repo details from here: http://www.linuxquestions.org/questions/linux-newbie-8/deleted-all-of-the-repos-in-yum-repos-d-how-to-restore-them-4175532866/
Your ca-bundles.crt are too old. One work-around until you upgrade to a newer version of CentOS would be to change the epel.repo from using https to http
sudo sed -i 's/https/http/g' /etc/yum.repos.d/epel.repo
+1 Spot on. But you shouldn't need to *upgrade* CentOS to grab the latest cert bundle (because of CentOS's long term support). `yum update ca-certificates` should do the trick (after disabling https for epel, or grabbing the rpm directly and updating using rpm).
@kev Well in theory your comment should work, but sadly for me when I ask `yum to update ca-certificates` I get **"No Packages marked for Update"**. In fact when I do a `yum list | grep ca-certificates` I get this _ca-certificates.noarch 2010.63-3.el6_1.5_ as the latest version on my CentOS 6.4 box. On my CentOS 6.5 box I get _ca-certificates.noarch 2014.1.98-65.1.el6_ So it looks like you need to at least update to CentOS 6.5 to get the latest CA-Ceritifcates from CentOS, or manually get the rpm and install it.
@Kev Rob nailed it. A lot of enterprise businesses are still on very old distros. I am working on CentOS4.5 for a client currently, and have to do a lot of things that normally shouldn't have to be done.
@RobD It looks like OP is using http and when I ran into the same issue I too was using http not https. So I'm just curious how would you deduce that ssl ca root certificates being outdated is the root cause?
@DwightSpencer sorry, I'm not understanding your question, what is OP? I deduced that my ssl ca root certificates were the issue because on my old CentOS 6.2 box I couldn't update, but on my 6.6 box I could. Simply changing from https to http solved the issue. I more or less just narrowed it down to that.
sudo sed -i "s/mirrorlist=https/mirrorlist=http/" /etc/yum.repos.d/epel.repo as explained here https://community.hpcloud.com/article/centos-63-instance-giving-cannot-retrieve-metalink-repository-epel-error
Try this (has to be root)
yum clean all yum check yum erase apf yum update ca-certificates yum upgrade
Worked perfectly and this is way more clean than some other answers on this thread.
I had to add a `yum update --disableplugin fastestmirror` pass in there because one of those steps (probably `yum clean`) removed info it needed to contact the mirrors. I told it "no" when it offered to do the upgrade, then did a plain `yum update` and it succeeded this time. I believe the first pass made it download a fresh mirror list from the main CentOS site, which let the second pass succeed.
Type "http://mirror.centos.org/centos/6" on your browser, and see, "addons" does not exist.
yum --disablerepo=addons update
Try doing following.
cd /etc/yum/yum.repos.d mv dries.repo dries.repo.bak
Or look for file that has http://mirror.centos.org/centos/6/addons/x86_64/repodata/repomd.xml and move it.
Then again do,
If you use 6.5, I don't know why, but doesn't exist the 6.5 directory at official yum repository for centOS. All packages will return a 404 status code
If you try this: http://mirror.centos.org/centos/6.5/os/x86_64/Packages/php-pear-1.9.4-4.el6.noarch.rpm you will get a 404, but if you try the 6.6 version: http://mirror.centos.org/centos/6.6/os/x86_64/Packages/php-pear-1.9.4-4.el6.noarch.rpm it works.
If you run "yum update" or "yum upgrade" without any other parameters all packages on your system including yum will be upgraded so there really is no need to upgrade yum on its own unless you are upgrading Fedora or CentOS versions.
In my case, which is really exceptional, the location of the XML file which contains the repo information is changed.
- I have Internet connection (
- When I run
yum upgrade, after a lot of
404error, I can get the names of packages I must download, but I cannot download them.
And, when I browse into the first 404 repo URL, which is:
and I see it absent. Going to its parent folder
http://mirror.airenetworks.es/CentOS/7.4.1708/readmeI get this:
This directory (and version of CentOS) is deprecated. For normal users, you should use /7/ and not /7.4.1708/ in your path. Please see this FAQ concerning the CentOS release scheme:
If you know what you are doing, and absolutely want to remain at the 7.4.1708 level, go to http://vault.centos.org/ for packages.
Please keep in mind that 7.4.1708 no longer gets any updates, nor any security fix's.
So, I have to go back to
/etc/yum.repo.dto edit the files.
[base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
I suspect that
$releaseveris no more in use, so I can test by changing it to
7:(remember to escape
we can get a list of files:
ftp://ftp.cesca.cat/centos/7.5.1804/os/x86_64/ http://ftp.rediris.es/mirror/CentOS/7.5.1804/os/x86_64/ http://ftp.cica.es/CentOS/7.5.1804/os/x86_64/ http://centos.mirror.minorisa.net/7.5.1804/os/x86_64/ http://repo.nixval.com/CentOS/7.5.1804/os/x86_64/ http://centos.uvigo.es/7.5.1804/os/x86_64/ http://ftp.uma.es/mirror/CentOS/7.5.1804/os/x86_64/ http://ftp.cixug.es/CentOS/7.5.1804/os/x86_64/ http://mirror.airenetworks.es/CentOS/7.5.1804/os/x86_64/ http://mirror.gadix.com/centos/7.5.1804/os/x86_64/
So, we can set the variable like this:
- Open the
- In the
yum install xxx.
- I have Internet connection (