我正在尝试按照wiki.linaro.org上的“在Ubuntu 10.04(Lucid)和10.10(Maverick)主机上安装交叉工具链”的指南进行操作(在我的Ubuntu 10.04虚拟机上)。第一步是:
但是当我运行时,我得到了以下结果:
我猜问题出在我雇主的代理服务器配置上,尤其是针对HTTPS的部分。
当我在Firefox中打开https://launchpad.net/api/1.0/~linaro-maintainers/+archive/toolchain时,出现了“连接超时”的提示。然后我进入Firefox首选项 -> 高级 -> 网络 -> 设置...,将HTTP代理设置为“gateway”,端口设置为8080,并勾选“对所有协议使用此代理服务器”。然后页面加载成功。这证实了我的理论。
我已经尝试设置http_proxy和https_proxy环境变量(大小写都试过):
我也尝试将它们改为:
我尝试将这第二行添加到/etc/apt/apt.conf文件中:
但是我继续遇到相同的错误。
我该如何解决这个问题?
更新:我按照接受的答案中的指示去"在代理后面的终端添加存储库和连接",取得了进展。
我在想,“HTTP fetch error”是否意味着我还需要在
更新 #2: 我已经添加了:
因为没有http_proxy。
欢迎任何建议。
更新 #3:由于我的虚拟机的主机是一台笔记本电脑,我把它带回家并在那里尝试(没有代理)。
它起作用了。所以问题与代理配置有关。但我想我有一个解决方法。
sudo add-apt-repository ppa:linaro-maintainers/toolchain
但是当我运行时,我得到了以下结果:
Error reading https://launchpad.net/api/1.0/~linaro-maintainers/+archive/toolchain: <urlopen error [Errno 110] Connection timed out>
我猜问题出在我雇主的代理服务器配置上,尤其是针对HTTPS的部分。
当我在Firefox中打开https://launchpad.net/api/1.0/~linaro-maintainers/+archive/toolchain时,出现了“连接超时”的提示。然后我进入Firefox首选项 -> 高级 -> 网络 -> 设置...,将HTTP代理设置为“gateway”,端口设置为8080,并勾选“对所有协议使用此代理服务器”。然后页面加载成功。这证实了我的理论。
我已经尝试设置http_proxy和https_proxy环境变量(大小写都试过):
$ set | grep -i proxy
HTTPS_PROXY=https://gateway:8080
HTTP_PROXY=http://gateway:8080
http_proxy=http://gateway:8080
https_proxy=https://gateway:8080
我也尝试将它们改为:
$ set | grep -i proxy
HTTPS_PROXY=gateway:8080
HTTP_PROXY=gateway:8080
http_proxy=gateway:8080
https_proxy=gateway:8080
我尝试将这第二行添加到/etc/apt/apt.conf文件中:
Acquire::http::proxy "http://gateway:8080/";
Acquire::https::proxy "https://gateway:8080/";
但是我继续遇到相同的错误。
我该如何解决这个问题?
更新:我按照接受的答案中的指示去"在代理后面的终端添加存储库和连接",取得了进展。
$ sudo add-apt-repository ppa:linaro-maintainers/toolchain
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 1DD749B890A6F66D050D985CF1FCBACA7BE1F97B
gpg: requesting key 7BE1F97B from hkp server keyserver.ubuntu.com
gpgkeys: HTTP fetch error 7: couldn't connect to host
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
我在想,“HTTP fetch error”是否意味着我还需要在
/etc/sudoers
中添加“Defaults env_keep = http_proxy”...更新 #2: 我已经添加了:
Defaults env_keep="http_proxy"
Defaults env_keep="https_proxy"
...就像bug 516032的评论18中所述,但我仍然遇到相同的“gpgkeys: HTTP fetch error 7: couldn't connect to host”错误。
而且这很奇怪:
$ sudo env | grep proxy
https_proxy=https://gateway:8080
因为没有http_proxy。
欢迎任何建议。
更新 #3:由于我的虚拟机的主机是一台笔记本电脑,我把它带回家并在那里尝试(没有代理)。
$ sudo add-apt-repository ppa:linaro-maintainers/toolchain
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 1DD749B890A6F66D050D985CF1FCBACA7BE1F97B
gpg: requesting key 7BE1F97B from hkp server keyserver.ubuntu.com
gpg: key 7BE1F97B: public key "Launchpad Linaro Overlay PPA" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
它起作用了。所以问题与代理配置有关。但我想我有一个解决方法。