首页 > 其他分享 >Mac 的brew 换源

Mac 的brew 换源

时间:2023-04-02 15:45:29浏览次数:33  
标签:core git mirrors Mac 换源 https brew homebrew

简介
Homebrew 是mac系统下一款自由及开放源代码的软件包管理系统,用以简化 macOS 系统上的软件安装过程。

Homebrew 主要有四个部分组成:

brew
homebrew-core
homebrew-bottles
homebrew-cask
名称 说明
brew Homebrew 源代码仓库
homebrew-core Homebrew 核心软件仓库
homebrew-bottles Homebrew 预编译二进制软件包
homebrew-cask 提供 macOS 应用和大型二进制文件
1.查看当前源
# 查看 brew.git 当前源
$ cd "$(brew --repo)" && git remote -v
origin https://github.com/Homebrew/brew.git (fetch)
origin https://github.com/Homebrew/brew.git (push)

# 查看 homebrew-core.git 当前源
$ cd "$(brew --repo homebrew/core)" && git remote -v
origin https://github.com/Homebrew/homebrew-core.git (fetch)
origin https://github.com/Homebrew/homebrew-core.git (push)
2.替换为阿里源
# 修改 brew.git 为阿里源
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

# 修改 homebrew-core.git 为阿里源
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

# zsh 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc

# bash 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

# 刷新源
$ brew update


3.替换为清华源
# 替换各个源
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
$ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git

# zsh 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc

# bash 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

# 刷新源
$ brew update

4.替换为中科大源
# 替换各个源
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
$ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

# zsh 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc

# bash 替换 brew bintray 镜像
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile

# 刷新源
$ brew update

5.重置为官方源
# 重置 brew.git 为官方源
$ git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git

# 重置 homebrew-core.git 为官方源
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git

# 重置 homebrew-cask.git 为官方源
$ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask

# zsh 注释掉 HOMEBREW_BOTTLE_DOMAIN 配置
$ vi ~/.zshrc
# export HOMEBREW_BOTTLE_DOMAIN=xxxxxxxxx

# bash 注释掉 HOMEBREW_BOTTLE_DOMAIN 配置
$ vi ~/.bash_profile
# export HOMEBREW_BOTTLE_DOMAIN=xxxxxxxxx

# 刷新源
$ brew update

 

 参考:

https://blog.csdn.net/jeikerxiao/article/details/128292957

标签:core,git,mirrors,Mac,换源,https,brew,homebrew
From: https://www.cnblogs.com/frantichow/p/17280592.html

相关文章

  • Find (and kill) process locking port 9000 on Mac
    Youcantrynetstatnetstat-vanptcp|grep9000FormacOSElCapitanandnewer(orifyournetstatdoesn'tsupport-p),uselsoflsof-itcp:9000sudolsof-i:9000Kill:kill-9<PID>PLEASENOTE:-9killstheprocessimmediately,a......
  • MacOS-Setup-GenshinImpact
    MacOS-Setup-GenshinImpact导航(返回顶部)1.GenshinImpact1.1国内安装包1.2国际安装包1.3云平台游戏2.安装2.1下载并安装PlayCover2.2添加ipa源2.3安装ipa软件3.登陆验证3.1关闭SIP3.2添加参数并登陆验证3.3重新开启SIP3.4补充阅读3.5更......
  • Mac 恢复出厂设置后
    下载的软件迅雷:下载工具snipaster:截图软件阿里云盘:网盘工具iterm2:终端pages:记笔记和写作工具infuse:流媒体播放器chrome浏览器ghelper:chrome插件配置配置homebrew清华源homebrewexportHOMEBREW_INSTALL_FROM_API=1exportHOMEBREW_API_DOMAIN......
  • OpenGL Mac开发-如何使用imgui(1.89.4)插件进行调试
    为了调试我们的OpenGLDemo,可以尝试使用一个成熟的开源GUI插件imgui。1,首先进入imgui在github上的地址。在Release中下载最近的版本,可以得到一个Zip压缩包。现在是2023年的4月1日,我下载到的版本是1.89.4,与Cherno的OpenGL教程中的代码略微有些区别。如果你看的是Cherno的教程,也......
  • Perceptron, Support Vector Machine and Dual Optimization Problem (3)
    SupportVectorMachinesPerceptronandLinearSeparability假设存在一个lineardecisionboundary,它可以完美地对trainingdataset进行分割。那么,经由上述PerceptronAlgorithm计算,它将返回哪一条linearseparator?当linearseparator(即一个给定的超平面)的margi......
  • 【macOS游戏】Phoenix Point
    原文来源于黑果魏叔官网,转载需注明出处。(下载请直接百度黑果魏叔)X-COM创作者著名的PhoenixPoint策略现已发布完整版,其中包括所有四年开发的所有添加、内容更新、游戏改进。现在有了支持模组!土地被占领了。外星人威胁突变危及人类的残余。只有凤凰计划,一个由最好的科学家和最勇敢的......
  • 更改MAC地址
    第一步左下角开始点击 设置   第二步打开网络和Internet     第三步点击高级网络设置中的更改适配器选项 第四步右键你现在连接的网络,再点击属性   第五步点击配置->高级 找到 网络地址 勾选这个 值 ,填上自己想要改的地址......
  • macos:用homebrew安装node/安装vue-cli( node v18.15.0/ Homebrew 4.0.10-119)
    一,用brew安装nodeliuhongdi@liuhongdideMacBook-ProHomebrew%brewinstallnode@18==>Downloadinghttps://formulae.brew.sh/api/formula.jws.json#=#=#==>Fetchingnode......
  • homebrew:常用命令(Homebrew 4.0.10-119)
    一,brew常用的命令1,查看brew下载文件的缓存目录liuhongdi@liuhongdideMacBook-ProHomebrew%brew--cache/Users/liuhongdi/Library/Caches/Homebrew2,查看brew的安装目录liuhongdi@liuhongdideMacBook-ProHomebrew%brew--prefix/usr/local也可以:liuhongd......
  • homebrew: 配置国内源(Homebrew 4.0.10-119)
    一,查看brew的安装目录:liuhongdi@liuhongdideMacBook-Propoem%cd"$(brew--repo)"liuhongdi@liuhongdideMacBook-ProHomebrew%pwd/usr/local/Homebrew说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest     对应的源......