How to use openSUSE zypper behind a HTTP proxy (with authentication)

Written by - 5 comments

Published on - last updated on April 11th 2024 - Listed in Linux Network Internet


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 HTTP proxies with 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 KB 7006845.


Add a comment

Show form to leave a comment

Comments (newest first)

Claudio from Switzerland wrote on Jun 14th, 2019:

Alex, which SUSE and zypper version are you using? The post is from 2014 so it is possible a lot has changed since.


Alex from wrote on Jun 14th, 2019:

Greetings... i've done those configurations as demonstrated but i'm still unable to update my system through the proxy using zypper....

getting errorcode "curl error 52"

any ideas?


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 from wrote on Jul 12th, 2017:

typo "/etc/syconfig/proxy" missing "s" change to /etc/sysconfig/proxy


RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder