apt-get代理服务器设置

$ vi /etc/apt/apt.conf.d/70debconf

未配置代理服务器

// Pre-configure all packages with debconf before they are installed.
// If you don't like it, comment it out.
DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
配置代理服务器
// Pre-configure all packages with debconf before they are installed.
// If you don't like it, comment it out.
DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};
Acquire::http::proxy "http://user:passwd@proxynj.test.com:8080";

命令行http, https, ftp代理服务器设置

$ vi /etc/profile

http_proxy=http://192.168.20.20:3128 # 指定http协议使用的代理服务器地址
https_proxy=http://192.168.20.20:3128 # 指定https协议使用的代理服务器地址
ftp_proxy=http://192.168.20.20:3128 # 指定ftp协议使用的代理服务器地址
no_proxy=192.168.20. # 访问局域网地址(192.168.20.0/24网段)时不使用代理,可以用逗号分隔多个地址

export http_proxy https_proxy ftp_proxy no_proxy

Logo

更多推荐