Header RSS Feed
 
If you only want to see the articles of a certain category, please click on the desired category below:
ALL Android Backup BSD Database Hacks Hardware Internet Linux Mail MySQL Monitoring Network Personal PHP Proxy Shell Solaris Unix Virtualization VMware Windows Wyse

How to use openSUSE zypper behind a proxy (with authentication)
Monday - Nov 10th 2014 - by - (3 comments)

Was trying to figure out, how to use "zypper" behind a http proxy which requires authentication. Because direct Internet access was cut, an installation through zypper would fail with this message:

geeko:~ # zypper se vnc
Download (curl) error for 'http://dl.google.com/linux/talkplugin/rpm/stable/x86_64/repodata/repomd.xml':
Error code: Connection failed

Turns out it's actually pretty easy - once you know how to do it.
In openSUSE there is a global proxy configuration file /etc/syconfig/proxy which can be edited to your needs. For example:

HTTP_PROXY="myproxy.example.com:8080"

This works fine if you don't require authentication to go through the proxy. But if you need authentication, zypper will still fail:

geeko:~ # zypper se vnc
Download (curl) error for 'http://dl.google.com/linux/talkplugin/rpm/stable/x86_64/repodata/repomd.xml':
Error code: HTTP response: 407
Error message: The requested URL returned error: 407 Proxy Authorization Required

Abort, retry, ignore? [a/r/i/? shows all options] (a): a

For authentication, the same file (/etc/sysconfig/proxy) is also used. The user and password can be entered into the HTTP_PROXY definition:

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

And voilĂ , zypper can now be launched right away (without having to re-login):

geeko:~ # zypper se vnc
Loading repository data...
Reading installed packages...
[...]

Additionally to this, there is also a helpful proxy exception definition which can be configured in /etc/syconfig/proxy:

NO_PROXY="localhost, 127.0.0.1, 10.0.0.0/8, 192.168.0.0/16"

This also applies to SLES (SuSE Linux Enterprise Server) and SLED (SuSE Linux Enterprise Desktop), see http://www.novell.com/support/kb/doc.php?id=7006845.

 

Add a comment

Show form to leave a comment

Comments (newest first):

ck from Switzerland wrote on Oct 11th, 2017:
Roshny, you obviously also need to check your firewall rules if this host is even allowed to connect to the Internet or to a HTTP Proxy.

Roshny from India wrote on Oct 11th, 2017:
I have done all this but still I cannot connect to the internet through the terminal. I cannot install softwares through YAST either. Please Help

Gordon Franke wrote on Jul 12th, 2017:
typo "/etc/syconfig/proxy" missing "s" change to /etc/sysconfig/proxy


Go to Homepage home
Linux Howtos how to's
Monitoring Plugins monitoring plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

6937 Days
until Death of Computers
Why?