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:

    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
    

    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

    it shows the same error on CentOS 6.9 "Error: Cannot retrieve repository metadata (repomd.xml) for repository: powerstack. Please verify its path and try again". I've changed mirror url from https to http already, but still the exists, Any idea?

  • Try this (has to be root)

    yum clean all
    yum check
    yum erase apf
    yum update ca-certificates
    yum upgrade
    

    Look at the [edit]

    Yay! It worked :)

    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.

    so, try yum --disablerepo=addons update

    So what Im supposed to do ?

    yum --disablerepo=addons update

    Same problem ...

    can we see your yum conf ?

    Look at the [edit]

    Have you something in /etc/yum.d/ ?

    [[email protected] yum.repos.d]# ls cactiez.repo CentOS-Debuginfo.repo CentOS-Vault.repo CentOS-Base.repo CentOS-Media.repo pgdg-93-centos.repo

  • 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.

  • 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.

  • 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.

  • 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.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM