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

 

posted @ 2020-03-14 15:10  叶建成  阅读(1293)  评论(0编辑  收藏  举报