3

I've a VM running Centos 5.5 and I'm trying to get yum to update via a company proxy.

I can browse the web within the VM using the proxy setting , but I cannot get yum to use the proxy.

I'm getting the following error:

[Errno 14] HTTP Error 302: The HTTP server returned a redirect error
that would lead to an infinite loop.
The last 30x error message was:
Found
Error: Cannot find a valid baseurl for repo: base

I've setup the proxy=http://my-proxy:8080/ and proxy_username= and proxy_password= in my /etc/yum.conf to the same values I'm using in firefox on the VM - which is working.

/etc/yum.repos.d has not been changed.

The proxy presents a web page upon initial 1st use of the proxy, asking for username and password. I think this could be causing the issue, is there any way yum can deal with this ?

3

I had the same issue, here's what worked for me:

  • Open the global proxy configuration file /etc/syconfig/proxy and add the following line:

    HTTP_PROXY="http://myusername:mypassword@myproxy.example.com:8080"

Source: https://www.claudiokuenzler.com/blog/515/use-opensuse-zypper-behind-with-http-proxy-authenticiation#.WYnT92fwvIU

EDIT: UPDATE You also need to add authentication details to the yum configuration file here: /etc/yum.conf

# The proxy server - proxy server:port number
proxy=http://mycache.mydomain.com:3128
# The account details for yum connections
proxy_username=yum-user
proxy_password=qwerty

Source: https://www.centos.org/docs/5/html/yum/sn-yum-proxy-server.html

2
  • Hi, perhaps consider posting the basic steps of the solution in the answer and then attributing it as you have done. Then if the link breaks, the answer is still present.
    – 111---
    Aug 8 '17 at 15:20
  • You got it, done.
    – Joel M.
    Aug 8 '17 at 15:25
2

The proxy presents a web page upon initial 1st use of the proxy, asking for username and password. I think this could be causing the issue, is there any way yum can deal with this ?

It's likely this is the problem, and there isn't much yum can do about it. It is possible that if you open the page in a browser, and complete the form ... yum will now work (yum clean expire-cache), but there is no good way for yum to deal with it directly.

0

Try this: Login into browser with the proxy credentials. Don't specify any credentials in yum.conf and just put proxy=http://my-proxy:8080.

This really depends how your proxy server is configured but this may work.

An ideal proxy server also accepts username/password as part of connection request (HTTP request headers) which is what yum relies on. But your proxy administrators have seem to disabled that support, restricting the logins from a web page only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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