当前位置:   article > 正文

Homebrew安装与配置_安装和配置homebrew

安装和配置homebrew

一. Homebrew介绍

Homebrew是一款macOS(或 Linux)软件包的管理工具。主要有四个部分组成: brewhomebrew-corehomebrew-caskhomebrew-bottles

名称说明
brewHomebrew 源代码仓库
homebrew-coreHomebrew 核心源
homebrew-cask提供 macOS 应用和大型二进制文件的安装
homebrew-bottles预编译二进制软件包

二. 安装Homebrew

# 安装
/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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

三. 更换镜像

分别替换brewhomebrew-corehomebrew-caskhomebrew-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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

四. Brew命令

软件默认安装路径:/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 startstop

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/558297
推荐阅读
相关标签
  

闽ICP备14008679号