首页 > 其他分享 >homerbrew source 设置

homerbrew source 设置

时间:2023-01-28 10:13:12浏览次数:52  
标签:git cn homerbrew source tsinghua 设置 edu brew homebrew

brew 默认使用 git 作为下载源,国内访问十分缓慢。需要我们手工切换国内镜像源提速。
截至 2023年1月,清华的源亲测可用。

替换步骤

1. 替换已安装目录 git 地址

如果已经安装过 brew,brew 目录内已经存储了 git 源地址,需要我们手工替换:

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

2. 修改 shell 初始化脚本设置 brew 环境变量

修改 shell 初始化脚本 (.zshrc 或 .bashrc) 初始化 brew 环境变量:

export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
# 下面两行设置请视自己的需要设置
export HOMEBREW_NO_INSTALL_CLEANUP=true
export HOMEBREW_NO_AUTO_UPDATE=true
###
eval "$(/opt/homebrew/bin/brew shellenv)"

3. brew update & upgrade

重新登录 shell 或 source .zshrc 以激活最新设置的 brew 环境变量,之后执行 brew update -v && brew upgrade
观察屏幕输出,源是否使用了我们最新的设置。

~ % brew update -v
HOMEBREW_BREW_GIT_REMOTE set: using https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git for Homebrew/brew Git remote.
remote: Enumerating objects: 72, done.
remote: Counting objects: 100% (72/72), done.
......
HOMEBREW_CORE_GIT_REMOTE set: using https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git for Homebrew/core Git remote.
remote: Enumerating objects: 277, done.
remote: Counting objects: 100% (277/277), done.

参考帮助

  1. 清华大学开源软件镜像站,Homebrew / Linuxbrew 镜像使用帮助:https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/

标签:git,cn,homerbrew,source,tsinghua,设置,edu,brew,homebrew
From: https://www.cnblogs.com/labs798/p/17069698.html

相关文章

  • Axure 表格中根据条件设置不同的字体样式--中继器
    中继器+表格,根据条件设置不同的字体样式思路:根据情形,设置不同的颜色,因为Axure不能直接对元件的样式进行交互设置,所以借助【动态面板】进行设置绘制表格详见:https://www......
  • idea增删改查环境设置
    一、环境设置1、Settings--Build,Execution,Deployment--Maven 2、Settings--Build,Execution,Deployment--Compiler--JavaCompiler  3、ProjectSettings--Pr......
  • 本地存储(localStorage)如何设置过期时间?
    思考在我们使用​​cookie​​​的时候是可以设置有效期的,但是​​localStorage​​​本身是没有该机制的,只能人为的手动删除,否则会一直存放在浏览器当中,可不可以跟cookie一......
  • C#将From窗体设置为桌面
    在用C#窗口应用程序写动态壁纸软件的时候,最核心的问题在于如何让一个窗口成为桌面,以及在置为桌面的时候全屏化,下面给出实现过程首先我们需要添加一个Win32的类,在命名空间......
  • model Sim 保存波形设置
    在Wave窗口File→SaveFormat保存do文件   在ModelSimSE窗口点击sim窗口的tb文件   点击File SaveDatasetsim保存wlf文件  之后如果需要重......
  • vs code设置上传下载文件到Linux
    1、打开vscode工具,点击扩展,选择SFTP安装  2、CTRL+SHIFT+P打开配置SFTP    3、选择上传下载,会提示输入密码,输入密码后开始传输文件 ......
  • P30 - window - 设置上拉触底的距离
    window设置上拉触底的距离概念:上拉触底是移动端的专有名词,通过手指在屏幕上的上拉滑动操作,从而加载更多数据的行为。设置步骤:app.json->window->为onReachBottom......
  • 表单中设置了 `keyup.enter.native` 的按键事件,但是回车后没有执行查询,反而会刷新页面
    From: https://www.cnblogs.com/shayloyuki/p/16524712.html 场景添加属性对话框中,input输入后点击enter,不会执行绑定的handleDialogQuery事件,反而会刷新整个页面;......
  • mac为终端Terminal设置代理访问
    这里我的ssport:1086,httpport:1087以下配置基于当前端口更换所有终端应用的代理如果没有设置代理的话,连github这个地址都上不去。临时设置exporthtt......
  • matplotlib中的标签设置
    一、方法matplotlib中自定义的刻度无法实现。在matplotlib版本大于3.2的时候,原来的设置方法就出现了问题#原方法set_xticks(ob1,ob2)#会出现ob2的值无法取代ob1的刻......