一、homebrew
直接安装
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
修改源安装
直接安装有可能因为源太慢而失败
- 下载install
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install - 修改brew_install
找到如下代码:
BREW_REPO = “https://github.com/Homebrew/brew“.freeze
CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“.freeze
复制代码更改为:
BREW_REPO = “https://mirrors.ustc.edu.cn/brew.git “.freeze
CORE_TAP_REPO = “https://mirrors.ustc.edu.cn/homebrew-core.git“.freeze - 执行安装
/usr/bin/ruby brew_install - 安装homebrew-core
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
cd $(brew --repo)
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd “$(brew --repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git - 更新
复制代码执行更新,成功:
brew update && breq upgrade
复制代码最后用这个命令检查无错误:
brew doctor
使用
% brew install wget