方法一

brew用curl下载,所以给curl挂上socks5的代理即可。

在~/.curlrc文件中输入代理地址即可。

socks5 = "127.0.0.1:1080"

方法二:替换源

替换为中科大源

  • 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
  • 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
  • 替换homebrew-cask.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
  • 替换Homebrew Bottles源:
    就是在/.bashrc或者/.zshrc文件末尾加
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles

这两个文件可以自己创建,/.bashrc和/.bash_profile都可以

重置源

  • 重置brew.git
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
  • 重置homebrew-core:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
  • 重置homebrew-cask:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://github.com/Homebrew/homebrew-cask.git
 

设置代理

为brew设置国外代理,mac的socks5代理设置:

start_proxy() {
export ALL_PROXY=socks5://19.68.6.32:1080
}
stop_proxy() {
unset ALL_PROXY
}

mac的http代理设置:

start_proxy() {
export http_proxy=12.168.6.32:
export https_proxy=12.18.6.32:
}
stop_proxy() {
unset http_proxy
unset https_proxy
}

github地址

brew使用的github地址为:https://github.com/Homebrew

使用brew --repo查看brew的本地仓库地址:

来源:https://www.jianshu.com/p/005963a4d843

https://mirrors.ustc.edu.cn/help/brew.git.html

homebrew代理设置的更多相关文章

  1. MacOS代理设置(桌面应用代理设置&Terminal代理设置)

    MacOS代理分为桌面应用代理设置&Terminal代理设置,使用代理软件默认只会开启桌面应用代理,Terminal代理需要单独配置   桌面应用代理设置 Terminal查看桌面应用代理设置 ...

  2. JMeter学习-024-JMeter 命令行(非GUI)模式详解(二)-执行代理设置

    闲话少述,接 上文 继续... 5.设置代理 jmeter -n -t JMeter分布式测试示例.jmx -H 20.9.215.90 -P 9999 -l report\01-result.csv ...

  3. android sdk manager 代理设置(送给牛逼的)

    解决android sdk更新慢的问题(公司竟然把sdk更新给墙了). 第一步:如下图 第二部:进入代理设置页面,进行设置.如下图  

  4. sdk更新代理设置

    sdk更新代理设置 http://www.cnblogs.com/zhoujg/p/4560998.html

  5. JAVA HTTP请求 常用的代理设置

    由于公司上网实行代理机制, 而最近一段时间又在研究Web上的OpenApi. 没办法一定要使用代理,我之前有文章介绍了httpclient的代理使用方式, 这里介绍基本java的代理使用方式. 最常使 ...

  6. http错误和异常处理,认证和代理设置

    http错误: import urllib.requestreq = urllib.request.Request('http://www.python.org/fish.html')try:urll ...

  7. Windows Server 2012远程刷新客户端组策略,IE代理设置

    Windows Server 2012远程刷新客户端组策略: 1.PowerShell命令对单台计算机进行刷新: Invoke-GPUpdate -RandomDelayInMinutes 0 -Co ...

  8. 魅族MX2代理设置

    魅族MX2买了快2年了,今天才知道有这个功能,唉 连接一个无线网络,比如我的centos 长按网络名字 选代理设置,设置自己的代理,再也不用SS 或 VPN 的android端了,老是提示ROOT权限 ...

  9. Nginx的安装及反向代理设置

    因为项目的缘故,接触到了Nginx的安装和反向代理设置,和大家分享下. 一.Nginx的下载.安装cd /homewget http://nginx.org/download/nginx-1.0.5. ...

随机推荐

  1. 将MSHFlexGrid1中记录导出为Excel

    1.添加引用Microsoft Excel 14.0 Object Library 2.编写代码部分 Private Sub Output_Click() Dim i As Integer '定义变量 ...

  2. Scala 基础(3)—— 基础类型和基础操作

    1. Scala 的一些基础类型 Scala 提供了 8 种基础类型,对应 Java 的 8 种基本数据类型. 其中包括: 整数类型:Byte, Short, Int, Long, Char 浮点类型 ...

  3. 【bzoj3831】[Poi2014]Little Bird 单调队列优化dp

    原文地址:http://www.cnblogs.com/GXZlegend/p/6826475.html 题目描述 In the Byteotian Line Forest there are   t ...

  4. [bzoj] 3224 Tyvj 1728 普通平衡树 || 平衡树板子题

    #include<cstdio> #define N 100010 #define which(x) (ls[f[(x)]]==(x)) using namespace std; int ...

  5. 洛谷 P3396 哈希冲突 解题报告

    P3396 哈希冲突 题目背景 此题约为NOIP提高组Day2T2难度. 题目描述 众所周知,模数的hash会产生冲突.例如,如果模的数p=7,那么4和11便冲突了. B君对hash冲突很感兴趣.他会 ...

  6. 洛谷 P3437 [POI2006]TET-Tetris 3D 解题报告

    P3437 [POI2006]TET-Tetris 3D 题目描述 The authors of the game "Tetris" have decided to make a ...

  7. Codeforces Round #324 (Div. 2) D

    D. Dima and Lisa time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

  8. Codeforces 934.B A Prosperous Lot

    B. A Prosperous Lot time limit per test 1 second memory limit per test 256 megabytes input standard ...

  9. How to install VIB on VMware ESXi

    What is VIB? A vib is  vSphere Installation Bundle. To make it more detailed, one can look at the vS ...

  10. POJ3207 Ikki's Story IV – Panda's Trick

    Time Limit: 1000MS   Memory Limit: 131072K Total Submissions: 9426   Accepted: 3465 Description liym ...