ubuntu的.pac文件-命令行

ubuntu的.pac文件-命令行,ubuntu,proxy,docker,Ubuntu,Proxy,Docker,我所处的环境使用复杂的代理设置,并使用.pac文件来描述/解析这些设置。我想在这个主要基于ubuntu的环境中设置一些VM和docker容器。典型的“系统-->首选项-->网络代理-->应用系统范围”答案没有多大帮助,因为我没有访问UI的权限。理想情况下,解决方案将真正应用于整个系统,即使用curl、wget、apt-get、pip和maven。有这样的解决方案吗?在命令行中没有设置“系统范围”代理的选项,您必须根据应用程序用户在多个文件中设置变量 几乎所有的命令行应用程序 编辑/etc/env

我所处的环境使用复杂的代理设置,并使用.pac文件来描述/解析这些设置。我想在这个主要基于ubuntu的环境中设置一些VM和docker容器。典型的“系统-->首选项-->网络代理-->应用系统范围”答案没有多大帮助,因为我没有访问UI的权限。理想情况下,解决方案将真正应用于整个系统,即使用
curl
wget
apt-get
pip
maven
。有这样的解决方案吗?

在命令行中没有设置“系统范围”代理的选项,您必须根据应用程序用户在多个文件中设置变量

几乎所有的命令行应用程序

编辑
/etc/environment

http_proxy=http://user:password@proxy:port/
https_proxy=http://user:password@proxy:port/    
ftp_proxy=http://user:password@proxy:port/   
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
HTTP_PROXY=http://user:password@proxy:port/  
HTTPS_PROXY=http://user:password@proxy:port/  
FTP_PROXY=http://user:password@proxy:port/  
NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
WGET

编辑
/etc/wgetrc

http_proxy=http://user:password@proxy:port/    
https_proxy=http://user:password@proxy:port/    
ftp_proxy=http://user:password@proxy:port/   
APT

编辑或创建
/etc/apt/apt.conf.d/95proxy

Acquire::http::proxy "http://user:password@proxy:port/";    
Acquire::ftp::proxy "ftp://user:password@proxy:port/";   
Acquire::https::proxy "https://user:password@proxy:port/";
pip --proxy <proxy> install <module>
卷曲

在家中编辑或创建
~/.curl.rc

proxy = user:password@proxy:port
PIP

我没有找到PIP的完整解决方案,因此我建议将PIP与命令变量
--proxy

Acquire::http::proxy "http://user:password@proxy:port/";    
Acquire::ftp::proxy "ftp://user:password@proxy:port/";   
Acquire::https::proxy "https://user:password@proxy:port/";
pip --proxy <proxy> install <module>
pip——代理安装
MAVEN

我从来没有用过maven,虽然我发现


希望对您有所帮助。

对于curl文件,文件名为~/.curlrc。这不讨论.pac文件的情况