设置全局代理,需要编辑profile文件
vi /etc/profile
文末添加以下代理配置,参考代理是否需要用户名密码
#无用户名密码
2. export http_proxy=http://proxy_ip:prot
3. export https_proxy=https://proxy_ip:prot
4.
#有用户名密码 export http_proxy=http://username:password@proxy_ip:prot export https_proxy=https://username:password@proxy_ip:port
生效配置文件
source /etc/profile
查看当前已设置代理
echo $http_proxy
echo $https_proxy