有时下载大模型总是下载不出来,要配置代理才行
一、Windows代理设置
① 系统全局代理设置
-
打开【设置】→【网络和Internet】→【代理】。
-
在【手动设置代理】下,打开开关,输入:
地址:10.10.10.215 端口:7897
-
点击【保存】。
② 命令行 (cmd/PowerShell) 代理设置
-
设置临时代理(本窗口有效):
set http_proxy=http://10.10.10.215:7897
set https_proxy=http://10.10.10.215:7897 -
若需要永久设置环境变量:
打开【控制面板】→【系统】→【高级系统设置】→【环境变量】,添加系统变量:
变量名:http_proxy
变量值:http://10.10.10.215:7897
变量名:https_proxy
变量值:http://10.10.10.215:7897
③ Git全局代理设置
git config --global http.proxy http://10.10.10.215:7897
git config --global https.proxy http://10.10.10.215:7897
二、Ubuntu代理设置
① 系统全局代理设置(图形界面)
打开【设置】→【网络】→【网络代理】选择【手动】,填入:
HTTP Proxy:10.10.10.215 端口:7897
HTTPS Proxy:10.10.10.215 端口:7897
② 终端命令行临时代理(仅当前终端有效):
export http_proxy=http://10.10.10.215:7897
export https_proxy=http://10.10.10.215:7897
③ 终端永久代理设置(适用于所有终端)
打开终端,编辑~/.bashrc
文件:
nano ~/.bashrc
在文件底部加入:
export http_proxy="http://10.10.10.215:7897"
export https_proxy="http://10.10.10.215:7897"
保存并退出,执行:
source ~/.bashrc
④ apt软件安装代理
临时代理(单次安装):
sudo apt -o Acquire::http::proxy="http://10.10.10.215:7897/" update
sudo apt -o Acquire::http::proxy="http://10.10.10.215:7897/" install package-name
永久代理(修改/etc/apt/apt.conf
):
sudo nano /etc/apt/apt.conf
加入以下内容并保存:
Acquire::http::proxy "http://10.10.10.215:7897/";
Acquire::https::proxy "http://10.10.10.215:7897/";
⑤ Git全局代理设置(Ubuntu):
git config --global http.proxy http://10.10.10.215:7897
git config --global https.proxy http://10.10.10.215:7897
✨ 以上方法可快速有效地为 Windows 和 Ubuntu 设置代理服务器为 10.10.10.215:7897
。