[SOLVED] http_proxy setting no effect (yum)
Posted: 2011/12/14 09:01:55
I am setting correctly for yum's proxy and proxy username and password, but still get HTTP Error 407. If I am right, HTTP Error 407 means need proxy auth.
(1)I have centos6 installed in Oracle virtualbox. the host is windows xp.
(2)I use bridged for centos6.
(3)Both windows xp and centos6 using proxy to connect to internet(our company using proxy 172.20.20.237:8080).
(4)I can open the www.centos.com via Firfox in centos6.
I have problem with the following command:
[root@localhost ~]# yum install telnet-server
the result:
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=os error was
14: HTTP Error 407 : http://mirrorlist.centos.org/?release=6&arch=i386&repo=os
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=extras error was
14: HTTP Error 407 : http://mirrorlist.centos.org/?release=6&arch=i386&repo=extras
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates error was
14: HTTP Error 407 : http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates
http://mirror.ta139.com/centos/6.1/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 407 : http://mirror.ta139.com/centos/6.1/os/i386/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
the /root/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
http_proxy="http://London\Tom Yang:Password1234x@172.20.20.237:8080"
export http_proxy
~
~
~
~
~
~
~
~
the file /etc/yum.repos.d/CentOS-Base.repo
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=Cent-OS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.ta139.com/centos/6.1/os/i386
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
~
~
~
the file /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
#proxy=http://172.20.20.237:8080/
#proxy_username=London\Tom Yang
#proxy_password=Password1234x
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
the file /etc/resolv.conf
# Generated by NetworkManager
domain shanghai.lom.com
search shanghai.lom.com
nameserver 172.20.11.10
nameserver 8.8.8.8 #this line is added by me
~
~
~
I search the internet, HTTP Error 407 means need proxy auth, but I have offered correct name and password.
The name is: London\Tom Yang, there is a space between Tom and Yang, and also there is London\ prefix, is this cause the auth failed?
but when I open page in the Firefox, I put the same username and password, it auth is ok and the request page opened.
Anyone can help me?
Thanks a lot.
(1)I have centos6 installed in Oracle virtualbox. the host is windows xp.
(2)I use bridged for centos6.
(3)Both windows xp and centos6 using proxy to connect to internet(our company using proxy 172.20.20.237:8080).
(4)I can open the www.centos.com via Firfox in centos6.
I have problem with the following command:
[root@localhost ~]# yum install telnet-server
the result:
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=os error was
14: HTTP Error 407 : http://mirrorlist.centos.org/?release=6&arch=i386&repo=os
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=extras error was
14: HTTP Error 407 : http://mirrorlist.centos.org/?release=6&arch=i386&repo=extras
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates error was
14: HTTP Error 407 : http://mirrorlist.centos.org/?release=6&arch=i386&repo=updates
http://mirror.ta139.com/centos/6.1/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 407 : http://mirror.ta139.com/centos/6.1/os/i386/repodata/repomd.xml
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
the /root/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
http_proxy="http://London\Tom Yang:Password1234x@172.20.20.237:8080"
export http_proxy
~
~
~
~
~
~
~
~
the file /etc/yum.repos.d/CentOS-Base.repo
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=Cent-OS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.ta139.com/centos/6.1/os/i386
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
~
~
~
the file /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
#proxy=http://172.20.20.237:8080/
#proxy_username=London\Tom Yang
#proxy_password=Password1234x
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
the file /etc/resolv.conf
# Generated by NetworkManager
domain shanghai.lom.com
search shanghai.lom.com
nameserver 172.20.11.10
nameserver 8.8.8.8 #this line is added by me
~
~
~
I search the internet, HTTP Error 407 means need proxy auth, but I have offered correct name and password.
The name is: London\Tom Yang, there is a space between Tom and Yang, and also there is London\ prefix, is this cause the auth failed?
but when I open page in the Firefox, I put the same username and password, it auth is ok and the request page opened.
Anyone can help me?
Thanks a lot.