yum and proxies (getting yum to work through a http proxy)

Yum does not seem to cope with proxies very well. I've seen many bugtraqs and other fault reports about people having problems with this, but it never seems to be fixed and I'm still experiencing the same problems in both the Fedora 13 and CentOS 5.5.

http_proxy environment

First of all, yum does not seem to mind the http_proxy environment variable any longer (it used to do that). Instead you have to specify proxy manually in /etc/yum.conf like this:

proxy=http://my.proxy.example.tld:3124

(3124=proxy port)

[Errno -1] Metadata file does not match checksum

Second of all, there seems to be issues with caching of metadata, which leads to the error where yum tries to download the latest metadata (updates/primary_db) and rejects it with the error message "[Errno -1] Metadata file does not match checksum".

Upon this yum tries the next mirror where it encounters the same error and goes to the next mirror and so on until it have tried all mirrors and ends with "Error: failure: repodata/primary.sqlite.bz2 from updates: [Errno 256] No more mirrors to try."

There seems to be several different problems, and I have not had the time to investigate all scenarios and in which case which method makes it work, so usually I do all 3 things. At least it always seems necessary to do #3 and clean all yum meta data.

1. Add the following to /etc/yum.conf

http_caching=packages

2. Disable the yum module "fastestmirror" by edit the file /etc/yum/pluginconf.d/fastestmirror.conf" and under [main] set enabled=0

3. Remove all cached yum metadata by running the following as root:

yum clean all




<< BACK TO KBIN'S STUFF











Comments