赞
踩
Homebrew是一款macOS(或 Linux)软件包的管理工具。主要有四个部分组成: brew
、homebrew-core
、homebrew-cask
、homebrew-bottles
。
名称 | 说明 |
---|---|
brew | Homebrew 源代码仓库 |
homebrew-core | Homebrew 核心源 |
homebrew-cask | 提供 macOS 应用和大型二进制文件的安装 |
homebrew-bottles | 预编译二进制软件包 |
# 安装
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 卸载
/bin/bash -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall)"
# 自升级
brew upgrade brew
分别替换brew
,homebrew-core
,homebrew-cask
和homebrew-bottles
:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.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
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew-cask.git
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
软件默认安装路径:/usr/local/Cellar/
命令 | 说明 |
---|---|
brew help | 查看帮助 |
brew search 软件名 | 搜索软件 |
brew info 软件名 | 查询指定软件信息 |
brew install 软件名 | 安装软件 |
brew install 软件名@版本号 | 安装指定版本的软件(安装前可先search有哪些版本) |
brew outdated | 检查哪些软件可更新 |
brew update | 升级所有软件 |
brew upgrade 软件名 | 升级指定软件 |
brew uninstall 软件名 | 卸载软件 |
brew cleanup | 清除所有软件的旧版本 |
brew cleanup 软件名 | 清除指定软件的旧版本 |
brew cleanup -n | 查看可清理的旧版本的软件,不做实际清除操作 |
brew pin 软件名 | 锁定指定软件,保证在全局更新时不更新 |
brew unpin 软件名 | 取消锁定指定软件 |
brew list | 查询已安装的软件信息 |
brew deps --installed --tree | 查看已安装软件的依赖,以树形展示 |
brew config | 查看Homebrew配置 |
brew services start | stop |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。