错误503:在代理后面使用apt-get update时服务不可用

我正在使用透明代理(其他框)。 当我尝试进行’apt-get update’时,我会收到这些警告(德语):

... W: Fehlschlag beim Holen von http://security.ubuntu.com/ubuntu/dists/maverick-security/restricted/source/Sources.gz 503 Service Unavailable W: Fehlschlag beim Holen von http://security.ubuntu.com/ubuntu/dists/maverick-security/universe/source/Sources.gz 503 Service Unavailable W: Fehlschlag beim Holen von http://security.ubuntu.com/ubuntu/dists/maverick-security/multiverse/source/Sources.gz 503 Service Unavailable W: Fehlschlag beim Holen von http://security.ubuntu.com/ubuntu/dists/maverick-security/main/binary-i386/Packages.gz 503 Service Unavailable W: Fehlschlag beim Holen von http://security.ubuntu.com/ubuntu/dists/maverick-security/restricted/binary-i386/Packages.gz 503 Service Unavailable W: Fehlschlag beim Holen von http://security.ubuntu.com/ubuntu/dists/maverick-security/universe/binary-i386/Packages.gz 503 Service Unavailable E: Einige Indexdateien konnten nicht heruntergeladen werden, sie wurden ignoriert oder alte an ihrer Stelle benutzt. 

我改变了〜.bashrc:

 http_proxy=http://192.168.120.199:8080 https_proxy=https://192.168.120:8080 export http_proxy export https_proxy 

我在命令行上写道:

 export http_proxy=http://proxyusername:proxypassword@proxyaddress:proxyport sudo apt-get update 

我编辑了/etc/apt/apt.conf:

 Acquire::http::proxy "http://192.168.120.199:8080/"; Acquire::ftp::proxy "http://192.168.120.199:8080/"; 

没有任何效果。

有谁知道如何通过透明代理使apt-get工作?

问候,

ubuntu2man

我不认为你可以在你的盒子上做任何事情。 503是代理的答案。 如果你确定,这是你设置的好代理(192.168.120.199:8080)那么这不是你的问题,而是代理的管理员。 如果是你,那么这是另一个问题,但是你需要询问代理,它是什么类型的代理软件,等等。 如果你非常确定你做好了事情就是这种情况。 但是您写道: export http_proxy=http://proxyusername:proxypassword@proxyaddress:proxyport现在我完全糊涂了,你需要基于密码的身份validation吗? 如果不是,为什么你在那里写了用户名/密码? 什么是“proxyaddress:proxyport,就像你之前写的那样,192.168.120.199:8080?

如果我是你,我会杀死你提到的文件中的所有这些修改,我会尝试只设置http_proxy等参数。 当它工作时,如果您不想每次手动设置,您就有时间修改内容。 因此,还原这些修改,只键入:

http_proxy=http://192.168.120.199:8080

export http_proxy

apt-get update

如果您的代理在端口8080上确实是192.168.120.199并且它确实不需要身份validation,那么它将起作用,并且您的代理管理员授予了对您的计算机的某种访问权限或不拒绝它。

另请注意,您所写的内容并非透明代理。 透明代理是你甚至不需要设置的东西,因为传出流量被自动“抓取”并重定向到强制通过代理(这就是为什么它是“透明的”:你甚至不需要指定它)。 您需要手动设置的内容:这不是透明代理。

今天有同样的问题。 我既是用户又是代理管理员。 来自security.debian.org的下载将因503服务不可用错误而失败,而其他镜像(例如ftp.it.debian.org)的下载完成没有问题,尽管两者都必须通过相同的代理。

(对于记录,代理机器和发出apt命令的服务器在物理上是不同的。)

这让我觉得错误可能与上游服务器暂时不可用有关。

某些代理实际上可能会根据user-agent字符串阻止流量。 一个简单的

 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 

也可能是你解决这个问题的解决方案