CentOS Icon CentOS Logo
CentOS Text
   
  
www.centos.org Forum Index
   CentOS 4 - General Support
  yum error behind proxy

 

 Bottom   Previous Topic   Next Topic
  •  Rate Thread
      Rate this Thread
      Excellent
      Good
      Average
      Bad
      Terrible
Poster Thread Rated:  1 Votes
  •  rlmcclain
      rlmcclain
yum error behind proxy
#1
Newbie
Joined: 2005/6/3
From
Posts: 2
Just installed Centos 4.0 from CDs. I am behind a proxy server which requires authentication. I can successfully browse the web with Firefox after configuring for the proxy in Firefox and responding to the authentication prompts. I can successfully run wget through the proxy (even downloading the xml file that yum failes on - see below). So far my only failure is with yum.

Reading the yum documentation and other forum and google comments, I see references to proxy setting in yum.conf and to the environment variable http_proxy. I've tried both with no success.

With the proxy defined in yum.conf and no http_proxy set, I get the following:

[root@dbatux etc]# yum update
Setting up Update Process
Setting up Repos
http://mirror.centos.org/centos/4/addons/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (111, 'Connection refused')>
Trying other mirror.
Cannot open/read repomd.xml file for repository: addons
failure: repodata/repomd.xml from addons: [Errno 256] No more mirrors to try.

With http_proxy set, I get the following:

[root@dbatux etc]# yum update
Setting up Update Process
Setting up Repos
addons 100% |=========================| 951 B 00:00
Traceback (most recent call last):
File "/usr/bin/yum", line 7, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 68, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 408, in doCommands
return self.updatePkgs()
File "/usr/share/yum-cli/cli.py", line 923, in updatePkgs
self.doRepoSetup()
File "/usr/share/yum-cli/cli.py", line 76, in doRepoSetup
repo.getRepoXML(text=repo)
File "repos.py", line 550, in getRepoXML
File "repos.py", line 527, in get
File "mirror.py", line 414, in urlgrab
File "mirror.py", line 400, in _mirror_try
File "grabber.py", line 605, in urlgrab
File "grabber.py", line 534, in _retry
File "grabber.py", line 591, in retryfunc
File "grabber.py", line 714, in __init__
File "grabber.py", line 758, in _do_open
File "grabber.py", line 835, in _make_request
File "/usr/lib/python2.3/urllib2.py", line 326, in open
'_open', req)
File "/usr/lib/python2.3/urllib2.py", line 306, in _call_chain
result = func(*args)
File "/usr/lib/python2.3/urllib2.py", line 491, in <lambda>
lambda r, proxy=url, type=type, meth=self.proxy_open: \
File "/usr/lib/python2.3/urllib2.py", line 498, in proxy_open
if '@' in host:
TypeError: iterable argument required

wget, however, works filne.

[root@dbatux etc]# wget http://mirror.centos.org/centos/4/addons/i386/repodata/repomd.xml
--15:04:43-- http://mirror.centos.org/centos/4/addons/i386/repodata/repomd.xml
=> `repomd.xml'
Connecting to 10.87.45.100:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 951 [text/xml]

100%[=======================================================>] 951 --.--K/s

15:04:44 (9.07 MB/s) - `repomd.xml' saved [951/951]

My http_proxy is set to this format "http://username:password@proxyip:port"

Thanks for help in advance.
Posted on: 2005/6/3 19:19
Create PDF from Post Print
Top
  •  hughesjr
      hughesjr
Re: yum error behind proxy
#2
WebMaster
Joined: 2004/12/5
From Corpus Christi, Texas, USA
Posts: 401
man yum says:

       proxy  url to the proxy server that yum should use.

       proxy_username
              username to use for proxy

       proxy_password
              password for this proxy


So in /etc/yum.conf try this:

proxy="http://proxyip:port"
proxy_username="username"
proxy_password="password"
Posted on: 2005/6/4 19:33
Create PDF from Post Print
Top
  •  rlmcclain
      rlmcclain
Re: yum error behind proxy
#3
Newbie
Joined: 2005/6/3
From
Posts: 2
Thanks, but as I said in my original post, I tried setting these three variables in yum.conf with the result below. I also tried increasing the errorllevel and debuglevel parameters, but yum produced no additional errors or logs.

[root@dbatux etc]# yum -d 10 update
Yum Version: 2.2.0
COMMAND: yum -d 10 update
Installroot: /
Setting up Update Process
Setting up Repos
Baseurl(s) for repo: ['http://mirror.centos.org/centos/4/addons/i386/']
http://mirror.centos.org/centos/4/addons/i386/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (111, 'Connection refused')>
Trying other mirror.
Cannot open/read repomd.xml file for repository: addons
failure: repodata/repomd.xml from addons: [Errno 256] No more mirrors to try.
Posted on: 2005/6/6 16:36
Create PDF from Post Print
Top
  •  kreyz28
      kreyz28
Re: yum error behind proxy
#4
Newbie
Joined: 2005/6/17
From
Posts: 1
I too had no success using the proxy options in yum.conf, instead I set the HTTP_PROXY variable in /etc/profile to make it work.

/etc/profile

......
HTTP_PROXY="http://yourproxy.yourdomain.com:80"
export HTTP_PROXY
.......

don't forget to source it to make it available
Posted on: 2005/6/17 13:31
Create PDF from Post Print
Top
  •  jimbojones
      jimbojones
Re: yum error behind proxy
#5
Newbie
Joined: 2005/9/12
From
Posts: 2
What do you mean by "don't forget to source it to make it available"?


Thanks
Posted on: 2005/9/12 19:36
Create PDF from Post Print
Top
  •  K_Frye
      K_Frye
Re: yum error behind proxy
#6
Professional Board Member
Joined: 2005/7/13
From Canada
Posts: 428
Quote:

jimbojones wrote:
What do you mean by "don't forget to source it to make it available"?


Thanks


The file needs to be "reloaded" for the changes to take effect.
Posted on: 2005/9/12 20:16
Create PDF from Post Print
Top
  •  blaz
      blaz
Re: yum error behind proxy
#7
Newbie
Joined: 2005/9/22
From Slovenija
Posts: 3
Hello

I'm use proxy allso, by hand with export ...
Today I find question and answer by hughesjr.

Like bingo. I try, but without succes to reach mirror. So I look in man and there find solution which hughesjr talk about.

So in /etc/yum.conf I change
proxy="http://proxyip:port"
proxy_username="username"
proxy_password="password"

to
proxy=http://proxy.mydomain.si:80/
proxy_username=
proxy_password=

I set proxy without username and password and write 3 lines without quotation.
And yum update start to work without exporting http...
Posted on: 2005/9/22 13:13
Create PDF from Post Print
Top
  •  Evolution
      Evolution
Re: yum error behind proxy
#8
WebMaster
Joined: 2005/2/22
From Augusta Georgia
Posts: 226
Does the proxy apply to ftp also? many times the yum+proxy issue can be fixed by simply using a mirror with ftp access instead of http access.
Posted on: 2005/9/22 13:28
Create PDF from Post Print
Top
  •  blaz
      blaz
Re: yum error behind proxy
#9
Newbie
Joined: 2005/9/22
From Slovenija
Posts: 3
yes, now I can also get ftp.
Posted on: 2005/9/22 13:43
Create PDF from Post Print
Top
  •  carknc
      carknc
Re: yum error behind proxy
#10
Newbie
Joined: 2006/2/8
From
Posts: 3
Hi --

I'm still having this issue myself. Putting HTTP_PROXY into my /etc/profile helped, now I get a 407 instead. Are there other variables I can set to get the username and password in there? Having them in my yum.conf didn't help at all.

Thanks.

EDIT: the fix is -- http_proxy=http://user:passwd@proxy.foo.com:portnumber
Posted on: 2006/2/8 17:19
Create PDF from Post Print
Top
  •  shawnbishop
      shawnbishop
Re: yum error behind proxy
#11
Newbie
Joined: 2005/5/16
From South Africa
Posts: 4
Hi

Good Day

I have read through this thread and I still dont see an answer?? I have tried to update the http_proxy in info in the yum.conf file as well as in the /user/.profile file.

I cant seem to do a yum update,or install software as It downloads it does the following

[root@nagios ~]# yum search nagios
Searching Packages:
Setting up Repos
update 100% |=========================| 951 B 00:00
http://mirror.centos.org/centos/4/os/i386/repodata/repomd.xml: [Errno 4] IOError: HTTP Error 400: Bad Request
Trying other mirror.
Cannot open/read repomd.xml file for repository: base
failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
[root@nagios ~]#


Now should the yum.conf file be updated or should the .profile be updated?
I used the following
http_proxy="http://username:passwd@150.1.1.49:80"

Cheers
Posted on: 2006/3/23 11:18
Create PDF from Post Print
Top
  •  cathal
      cathal
Re: yum error behind proxy
#12
Newbie
Joined: 2006/4/12
From
Posts: 1
Try the python fix at the following link and it should remedy the situation:

https://sourceforge.net/tracker/index.php?func=detail&aid=1185444&group_id=5470&atid=305470

Thanks
Posted on: 2006/4/12 15:36
Create PDF from Post Print
Top
 Top   Previous Topic   Next Topic

 


 You cannot start a new topic.
 You can view topic.
 You cannot reply to posts.
 You cannot edit your posts.
 You cannot delete your posts.
 You cannot add new polls.
 You cannot vote in polls.
 You cannot attach files to posts.
 You cannot post without approval.




"Linux" is a registered trademark of Linus Torvalds. | All other trademarks are property of their respective owners. | All other content is Copyright @ 2004-2009 by the CentOS Project or "each individual contributor (forums, comments, etc.) unless otherwise assigned".| Theme based on a theme by 7dana.com