The other day I wrote an article on how to fix PYCURL error 7 , but there’s another more annoying error Pycurl error 22, let’s fix that


Short Solution: Disable Yum Addons

Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again

Looks like I did not pay attention the other day when I tried to fix Pycurl error 7 and downloaded an outdated CentOS-Base.repo for CentOS4, which is giving me the exact issue above. CentOS 6 apparently does no longer support the “addons” repo.

yum --disablerepo=addons update

If that doesn not work, fetch the latest CentOS-Base.repo from github rather than centos.org. The URL is https://github.com/dayne/yum/blob/master/centos6/CentOS-Base.repo

1 Upgrade CentOS Version

As mentioned before, yum has a lot of hiccups and is rather unrealiable if you misconfigured it.

The first thing you should know is that CentOS devs dont support old CentOS versions like 6.4 – you may have to upgrade your CentOS version if you are on this distribution.

You can find more information on checking your CentOS version here.

However, it is more likely a problem with yum.

2 Clean Yum

Next, we can try to clean yum to see if that fixes our problem:

yum clean all

You should get a response: Cleaning up Everything

If that doesn’t fix your problem right away, let us run a few more commands that will make sure you have a clean and up to date version of yum:

yum check 
yum upgrade

One command that I only recommend using if you know what you are doing will remove the firewall afp. It is better to install the csf firewall – if you are capable of doing that, run the following command after installing csf:

yum erase apf

3 Check Your Yum Repository Folder

Lastly, we can check the yum folder again:

cd /etc/yum.repos.d

Once in there enter dir to see whats in the folder. If you see any custom repositories without a leading CentOS, they may be custom repositories such as Atomicorp’s package, EPEL or your webhost may have put them there. In that case, a misconfigured repo will cause conflicts with your default “Base” repository and cause the error The requested URL returned error: 404 Not Found.

When you look at http://mirror.centos.org/centos/6/ – you will see that CentOS does not provide an addons folder, so you need to verify that the repos in that directory do not link to that specific URL that is simply outdated (leftover from previous CentOS versions).

4 Alternative Solution: Install EPEL

There are many other open-source repositories that you can install to get your packages. EPEL is only one of them, give it a try.

Read our guide: Installing Epel Repo on CentOS 6