How to Fix Yum Pycurl Error 22 in CentOS

Question

I am having repodata problem in my CentOS virtual Machine. I can’t update or install software using yum command. Only get the following yum pycurl error 22 message.

http://centos.excellmedia.net/6.6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"

What should I do to Solve This problem. CentOS Version is 6.5.

Answer

Most of the time yum pycurl error 22 can be solved by cleaning yum cache. Open Linux terminal and enter the following command.

yum clean all

This will clean the everything in the cache directory.

Flush Iptables

Iptables Firewall also sometimes causes the problem. So flush iptables and retry to install or update software. Read This Tutorial to learn How to Flush iptables properly.

If iptables is the problem add following rules to /etc/sysconfig/iptables file to solve the problem.

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT

-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT

* Allow Outgoing traffic to tcp port 80. Yum connects to the mirrors using http protocol.
* Allow Outgoing traffic on UDP Port 53 for DNS resolutions.

Read Following CentOS forums Yum Not Working: Error: Cannot retrieve repository metadata (repomd.xml) for more information if you need.