Ubuntu apt pip conda 代理设置

终端临时代理(关闭终端失效,当前用户永久生效修改~/.bashrc,所有用户永久生效修改/etc/profile,修改之后运行source ~/.bashrc或者source /etc/profile)

export http_proxy="127.0.0.1:1081"
export https_proxy="127.0.0.1:1081"

一、apt

1、永久方式

修改文件/etc/apt/apt.conf

Acquire::http::proxy "http://127.0.0.1:1081";

或者-c指定配置文件

sudo apt -c ~/apt_proxy.conf update

2、临时使用

sudo apt -o Acquire::http::proxy="http://127.0.0.1:1081" update

二、pip

pip --proxy http://127.0.0.1:1081 install pip -U

三、conda

在~/.condarc追加

proxy_servers:
  http: http://127.0.0.1:1081
  https: https://127.0.0.1:1081
原文地址:https://www.cnblogs.com/jacen789/p/12492213.html