I'm using CentOS 6.3. When I try to update my system with yum I have this message:

yum update

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

yum check

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

yum upgrade

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

My yum.conf

[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
  • 1
    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 – Kiwy Jan 16 '14 at 10:43
  • You need to fix the internet connectivity first. Re-installing might be an option. Or try booting a live CD system. – peterph Jan 16 '14 at 14:08
  • I solved the problem by deleting "yum.repos.d" folder and recreate an example.repo file. add repo details from here: linuxquestions.org/questions/linux-newbie-8/… – tenki Jul 21 '17 at 1:19

10 Answers 10

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
  • 2
    +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 Nov 12 '14 at 20:25
  • @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. – Rob D Dec 18 '14 at 2:11
  • @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. – SgtPooki May 21 '15 at 19:00
  • @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? – Dwight Spencer Jun 11 '15 at 8:28
  • @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. – Rob D Jul 23 '15 at 0:20

Try this

yum clean all
yum check
yum erase apf
yum upgrade
  • Look at the edit – az93 Jan 16 '14 at 10:00
  • Yay! It worked :) – facundofarias Jun 4 '15 at 16:11
  • 1
    Worked perfectly and this is way more clean than some other answers on this thread. – Dwight Spencer Jun 11 '15 at 8:26

Type "http://mirror.centos.org/centos/6" on your browser, and see, "addons" does not exist.

so, try yum --disablerepo=addons update

  • So what Im supposed to do ? – az93 Jan 16 '14 at 10:09
  • yum --disablerepo=addons update – Amauche Jan 16 '14 at 10:16
  • Same problem ... – az93 Jan 16 '14 at 10:25
  • can we see your yum conf ? – Amauche Jan 16 '14 at 10:32
  • Look at the edit – az93 Jan 16 '14 at 10:34

All of the previous answers did not work for me, but running the following commands did:

$ sudo yum remove centos-release-SCL
$ sudo yum update # Update to CentOS 6.8
$ sudo yum install centos-release-scl
$ sudo yum update

Which I got from this blog post.

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,

yum update

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.

The problem for me was that the repos use https and that doesn't work.

cd /etc/yum.repos.d/
grep -RFi "https" *

This shows in what repo files https is used. Open them in an editor and make it http. For me that fixed the problem.

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 fact I need to install ftp. But when I use yum install ftp I go the same problem. – az93 Jan 16 '14 at 10:03

I installed CentOS via Vagrant, and it came with the /etc/yum.repos.d/ directory prepopulated with things like puppet.repo. Lo and behold, puppet.repo and other included repos did not point to valid resources.

So I removed them and yum works now.

In my case, which is really exceptional, the location of the XML file which contains the repo information is changed.

  • I have Internet connection (ping 8.8.8.8 works)
  • When I run yum upgrade, after a lot of 404 error, 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:

http://mirror.airenetworks.es/CentOS/7.4.1708/os/x86_64/repodata/repomd.xml

and I see it absent. Going to its parent folder http://mirror.airenetworks.es/CentOS/7.4.1708/readme I 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:

https://wiki.centos.org/FAQ/General

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.d to edit the files.

I have:

[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 $releasever is no more in use, so I can test by changing it to 7:(remember to escape & with \)

curl http://mirrorlist.centos.org/?release=7\&arch=x86_64\&repo=os\&infra=arch

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:

  1. Open the /etc/yum.repo.d/CentOS-Base.repo
  2. In the [base] section, define: releasever=7.
  3. Re-run yum upgrade or yum install xxx.

protected by Community May 1 '15 at 16:05

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.