美文网首页
ubuntu24 设置网络代理

ubuntu24 设置网络代理

作者: xiaohei08 | 来源:发表于2025-04-20 11:37 被阅读0次

apt设置代理
打开apt代理配置文件

vi /etc/apt/apt.conf.d/proxy.conf

添加如下代理信息:

Acquire::http::Proxy "http://username:password@proxy-server-ip:8181/";
Acquire::https::Proxy "https://username:password@proxy-server-ip:8182/";

备注:使用export设置代理对apt无效

curl代理设置
直接在命令中加代理参数,具体如下:

curl -x "http://user:pwd@127.0.0.1:1234" "http://httpbin.org/ip"
curl --proxy "http://user:pwd@127.0.0.1:1234" "http://httpbin.org/ip"

此外,在 环境变量中设置临时设置代理:

# 设置 http proxy
export http_proxy="http://user:pwd@127.0.0.1:1234"
# 设置 https proxy
export https_proxy="http://user:pwd@127.0.0.1:1234"
取消 http,https 代理


unset http_proxy
unset https_proxy

或者在配置文件(如.bashrc)中配置代理

# 设置 http proxy
export http_proxy="http://user:pwd@127.0.0.1:1234"
# 设置 https proxy
export https_proxy="http://user:pwd@127.0.0.1:1234"

对curl同样生效

docker设置代理
Docker代理配置

git设置代理
git配置网络代理

相关文章

  • Ubuntu设置代理

    Ubuntu14.04设置网络代理 buntu下apt-get的网络代理设置(终端命令行的网络代理设置) 方法一:...

  • 代理设置

    终端代理设置 wget设置代理 curl 设置代理 git 设置代理 ssh 代理 nc命令 网络工具 digns...

  • git ssh代理设置

    终端代理设置 wget设置代理 curl 设置代理 git 设置代理 ssh 代理 nc命令 网络工具dignsl...

  • nw_proxy_resolver_create_parsed_

    这主要是在Mac系统中设置了网络自动代理而导致 解决方案:系统偏好设置 → 网络 → 高级 → 代理 → 自动代理...

  • Chrome + Lantern

    2020.07.21 将网络连接设置为英文名称 将代理设置设置为下图代理设置.PNG

  • mac怎么设置网络代理

    1 设置代理 依次选择:系统偏好设置->网络->高级->代理,设置代理的host和端口,并添加例外: 2 小tip...

  • emacs操作 - 配置篇

    基本配置 设置字体 设置网络代理 在内网环境需要设置

  • Mac上Safari、APP Store无法连接服务器但QQ可正

    系统偏好设置——网络——高级——代理,把“网页代理”和“安全网页代理”复选框去掉,保存设置,OK。

  • Set up k8s-client-go for etcd v2

    网络 首先解决网络连接问题,mac shadowsocks 默认监听本地 代理 git 设置 git 代理 go ...

  • Expo文档

    利用代理排错 MacOS代理配置(Sierra) 如果发生了错误,您可以在系统网络设置中切到自动代理设置,使用自动...

网友评论

      本文标题:ubuntu24 设置网络代理

      本文链接:https://www.haomeiwen.com/subject/oofvbjtx.html