Skip to content

Latest commit

 

History

History
101 lines (59 loc) · 2.67 KB

homebrew.md

File metadata and controls

101 lines (59 loc) · 2.67 KB

...menustart

...menuend

homebrew

Reset Homebrew Fomular

$ cd $(brew --repo)/Library/Taps/homebrew/homebrew-core/
$ git reset --hard HEAD

Manually download brew package

  • use brew --cache to find the cache folder
  • homebrew use brew --cache\downloads folder to keep downloaded files
    • and use ln -s to make a reference at brew --cache folder
  • 目标文件 可以通过如下命令获得
    • brew --cache [-s] <package_name> ( -s means from source , not bottle )

Homebrew 使用 清华索引

brew update 索引镜像

替换现有上游:

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

brew update

恢复官方

git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git

git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git

git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git

brew update

brew binary 安装包 镜像

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles

初次安装 homebrew 出问题...

  1. 先下载 brew install 文件 ( 安装命令的 curl 那一段 ), 保存为 brew_install
  2. 修改

    BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze
    CORE_TAP_REPO="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git".freeze
  3. ruby brew_install 安装
  4. 安装完成后,替换homebrew源
  5. brew update