这用于在VirtualBox VM中安装Ubuntu 13.04 Desktop。我在xyz251:9090上具有HTTP代理的公司网络上。我已经使用自动配置脚本配置了来宾操作系统,因此Firefox可以正常工作,但是无法使用代理连接获得“ apt-get”或“ Ubuntu软件中心”。
我创建了文件“ /etc/apt/apt.conf”,它现在包含一行文本:
Acquire::http:Proxy "http://x.y.z.251:9090"
这是我在“系统设置/网络/网络代理”中指定并应用于整个系统的proxy.pac文件。
当我使用Firefox时,数据包跟踪显示TCP连接是通过公司代理在端口9090进行的,当我运行“ Ubuntu软件中心”和“ apt-get”时,数据包跟踪显示带有最终目标IP的TCP SYN数据包地址和端口80。当然,对SYN数据包没有任何响应,因为公司防火墙阻止了端口80上的TCP连接进出。
在终端窗口中使用“ sudo apt-get”,我总是看到:
Ign cdrom://Ubuntu 13.04 _Raring Ringtail_ - Release amd64 (20130424) raring/main Translation-en_US
Ign cdrom://Ubuntu 13.04 _Raring Ringtail_ - Release amd64 (20130424) raring/main Translation-en
Ign cdrom://Ubuntu 13.04 _Raring Ringtail_ - Release amd64 (20130424) raring/restricted Translation-en_US
Ign cdrom://Ubuntu 13.04 _Raring Ringtail_ - Release amd64 (20130424) raring/restricted Translation-en
Err http://extras.ubuntu.com raring Release.gpg
Could not connect to extras.ubuntu.com:80 (91.189.92.152), connection timed out
Err http://archive.canonical.com raring Release.gpg
Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1b 80]
Err http://us.archive.ubuntu.com raring Release.gpg
Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::14). - connect (101: Network is unreachable) [IP: 2001:67c:1562::14 80]
Err http://us.archive.ubuntu.com raring-updates Release.gpg
Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::14). - connect (101: Network is unreachable) [IP: 2001:67c:1562::14 80]
Err http://us.archive.ubuntu.com raring-backports Release.gpg
Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::14). - connect (101: Network is unreachable) [IP: 2001:67c:1562::14 80]
59% [Connecting to security.ubuntu.com (91.189.91.14)]
最终,我看到了:
Err http://security.ubuntu.com raring-security Release.gpg
Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
Reading package lists... Done
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring/Release.gpg Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::14). - connect (101: Network is unreachable) [IP: 2001:67c:1562::14 80]
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring-updates/Release.gpg Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::14). - connect (101: Network is unreachable) [IP: 2001:67c:1562::14 80]
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/raring-backports/Release.gpg Cannot initiate the connection to us.archive.ubuntu.com:80 (2001:67c:1562::14). - connect (101: Network is unreachable) [IP: 2001:67c:1562::14 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/Release.gpg Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1360:8c01::18). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::18 80]
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/raring/Release.gpg Cannot initiate the connection to archive.canonical.com:80 (2001:67c:1360:8c01::1b). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8c01::1b 80]
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/raring/Release.gpg Could not connect to extras.ubuntu.com:80 (91.189.92.152), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
我完全不确定自己在做什么错。
---更新----我也尝试过:
Acquire::http:proxy "http://user:pass@x.y.z.251:9090/"
“ xyz”当然是占位符;我怀疑老板的保安人员会不会友好地请我发布实际数字。我发现数据包跟踪没有区别-“ apt-get”仍在使用真实IP地址和端口80。我在apt.conf文件中故意犯了一个错误,“ apt-get”退出并出现了错误,所以我可以肯定的是,它看到了该代理的配置行,但似乎并没有兑现它。
我使用的是“ NAT”网络连接,因为这违反了IT策略在网络之间架桥,而DHCP服务器仅将地址提供给已知的MAC地址。我不希望IT安全问题再次发生。
:
之间的冒号?相反。http
Proxy
http::Proxy
http:Proxy