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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM