如何在ubuntu中设置终端代理?

时间:2017-01-06 09:42:47

标签: python linux ubuntu proxy virtualbox

我的情景:

我正在尝试在我新安装的ubuntu中安装python和postgresql,它在Windows 7上通过virtualbox运行。它使用我的公司网络,我在ubuntu的网络设置中设置了代理。

我可以使用mozilla(ubuntu)浏览和下载没有问题。

问题:

但是当我尝试使用终端安装软件包时,它只停留在0%。它尝试了各种IP,仍然是0% my terminals screenshot

[更新] - 结束无法连接到IP

尝试:

我已尝试通过

导出代理设置
  

sudo -H gedit /etc/profile.d/proxy.sh

并使用

更新文件
  

导出http_proxy = http://username:password@proxyhost:port/

(我也为https设置了

请让我知道发生了什么问题?

4 个答案:

答案 0 :(得分:3)

这将非常简单。我为这个

创建了一个python 3脚本

proxy_configuration

下载并运行它。您可以非常快速地设置和删除系统范围的代理。

步骤: 1)以zip格式下载并解压缩。 2)打开终端并导航到解压缩文件的文件夹。 3)键入以下命令
   chmod + x proxy.py
   sudo ./proxy.py

欢呼!

答案 1 :(得分:2)

找到答案,

请点击here

导出选项对于这种情况不起作用

答案 2 :(得分:1)

在Ubuntu中设置代理:

编辑 /etc/apt/apt.conf 文件并添加以下内容:

Acquire::http::proxy "http://ProxyHOST:ProxyPORT/";
Acquire::https::proxy "https://ProxyHOST:ProxyPORT/";

希望它能帮助...... :)

答案 3 :(得分:0)

Acquire::http::proxy "http://edcguest:edcguest@172.31.100.27:3128/";

Acquire::https::proxy "https://edcguest:edcguest@172.31.100.27:3128/"; Acquire::ftp::proxy "ftp://edcguest:edcguest@172.31.100.27:3128/"; Acquire::socks::proxy "socks://edcguest:edcguest@172.31.100.27:3128/";