通过代理建立互联网连接但无法正常工作

通过代理建立互联网连接但无法正常工作

我的机器位于自动配置的代理后面(不确定是什么类型,可通过 http 访问,不需要用户凭据)。

我已连接到互联网,但似乎只有 Firefox 能够解析 URL。APT 则不能。

所以看起来代理允许 Firefox 解析名称,但不允许其他应用程序解析?是否可以以某种方式配置 apt 以规避此限制?

当我在 sources.list 中手动输入 de.archive.ubuntu.com 的 IP 地址时,出现“无路由到主机”错误。

截至目前,代理服务器已使用 Ubuntu 网络设置 GUI 配置。

apt 的输出:

Err:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease
  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)

Err:2 http://de.archive.ubuntu.com/ubuntu cosmic InRelease
  Something wicked happened resolving 'de.archive.ubuntu.com:http' (-5 - No address associated with hostname)

Err:3 http://de.archive.ubuntu.com/ubuntu cosmic-updates InRelease
  Something wicked happened resolving 'de.archive.ubuntu.com:http' (-5 - No address associated with hostname)

Err:4 http://de.archive.ubuntu.com/ubuntu cosmic-backports InRelease
  Something wicked happened resolving 'de.archive.ubuntu.com:http' (-5 - No address associated with hostname)

Reading package lists... Done

Building dependency tree

Reading state information... Done

All packages are up to date.

W: Failed to fetch http://de.archive.ubuntu.com/ubuntu/dists/cosmic/InRelease  Something wicked happened resolving 'de.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://de.archive.ubuntu.com/ubuntu/dists/cosmic-updates/InRelease  Something wicked happened resolving 'de.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://de.archive.ubuntu.com/ubuntu/dists/cosmic-backports/InRelease  Something wicked happened resolving 'de.archive.ubuntu.com:http' (-5 - No address associated with hostname)

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/cosmic-security/InRelease  Something wicked happened resolving 'security.ubuntu.com:http' (-5 - No address associated with hostname)

W: Some index files failed to download. They have been ignored, or old ones used instead.

答案1

Firefox(与其他浏览器一样)有自己的内部代理设置。CLI 应用程序apt-get看不到这一点,它们依赖于http_proxy(是的,据我所知是小写的)环境变量:

export http_proxy="http://PROXY_SERVER:PORT"

相关内容