Homebrew
homebrew,mac软件包的管理器,国内源安装
homebrew官网,mac软件包的管理器,国内源安装
什么是homebrew?
简而言之,就是一个应用市场,就好比 win 上的软件管家(不是安全管家哈,这个只有安装、删除等管理软件包的功能)官方定义的是:macOS 缺失的软件包的管理器
homebrew官网: https://brew.sh/
Homebrew国内源
- 清华源
- https://mirrors.tuna.tsinghua.edu.cn/help/homebrew
- 中科大源
- http://mirrors.ustc.edu.cn/help/brew.git.html
Homebrew 是一款自由及开放源代码的软件包管理系统,用以简化 macOS 和 linux 系统上的软件安装过程。它拥有安装、卸载、更新、查看、搜索等很多实用的功能,通过简单的一条指令,就可以实现包管理,十分方便快捷。
Homebrew 主要有四个部分组成: brew、homebrew-core 、homebrew-bottles、homebrew-cask。
| 名称 | 说明 |
|---|---|
| brew | Homebrew 源代码仓库 |
| homebrew-core | Homebrew 核心软件仓库 |
| homebrew-bottles | Homebrew 预编译二进制软件包 |
| homebrew-cask | 提供 macOS 应用和大型二进制文件 |
HomeBrew安装
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"建议使用:中科院
卸载
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"
HomeBrew换源
中科大(建议使用)
git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.gitgit -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.gitgit -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.gitbrew updateecho 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles' >> ~/.bash_profilesource ~/.bash_profile
阿里云
cd "$(brew --repo)"git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.gitcd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.gitbrew updateecho 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profilesource ~/.bash_profile
清华
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.gitgit -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.gitgit -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.gitbrew updateecho 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles' >> ~/.bash_profilesource ~/.bash_profile
腾讯
git -C "$(brew --repo)" remote set-url origin https://mirrors.cloud.tencent.com/homebrew/brew.gitgit -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.cloud.tencent.com/homebrew/homebrew-core.gitgit -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.cloud.tencent.com/homebrew/homebrew-cask.gitbrew update