error 503: service unavailable when using apt-get update behind proxy

Some proxies might actually block traffic based on the user-agent string. A simple

echo 'Acquire { http::User-Agent "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"; };' >> /etc/apt/apt.conf

Might also be your solution to this 503 problem


I don't think that you can do anything with this on your box. 503 is the answer from the proxy. If you were sure, it's the good proxy what you set (192.168.120.199:8080) then it's not your problem, but the administrator's of the proxy. If it's you, then it's another question but then you need to ask about the proxy, what kind of proxy software it is, and so on. This is the case, if you are very sure you set up things well. However you wrote: export http_proxy=http://proxyusername:proxypassword@proxyaddress:proxyport Now I am totally confused, do you need password based authentication? If no, why did you wrote username/password there? And what was "proxyaddress:proxyport, the same as you wrote about before, 192.168.120.199:8080?

If I were you, I would kill all of these modifications in files you mentioned, and I would try only to set up http_proxy and etc parameters. When it works, you have time to modify things if you don't want to set up manually each time. So, revert those modifications, and type only this:

http_proxy=http://192.168.120.199:8080

export http_proxy

apt-get update

It will work, if your proxy is really 192.168.120.199 on port 8080 and it really does not need authentication, and your proxy administrator granted some kind of access to your machine or not rejecting it.

Also please note that what you wrote about is not a transparent proxy. Transparent proxy is something what you don't even need to set up, since the outgoing traffic is automatically "grabbed" and redirected to force through the proxy (that's why it's "transparent": you don't even need to specify it). What you have to set manually: that's not a transparent proxy.


Had the same problem today. I'm both the user and the proxy admin. Downloads from security.debian.org would fail with a 503 service unavailable error, whereas downloads from other mirrors (e.g. ftp.it.debian.org) completed without issues, despite both having to pass through the same proxy.

(For the record, the proxy machine and the server from which the apt commands were issued are physically different.)

This makes me think the error might be related to a temporary unavailability of upstream server.