macOS M1安装HomeBrew
macOS M1安装HomeBrew
Homebrew是什么?
- Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷。
Homebrew的安装和使用
参考:https://blog.csdn.net/sinat_38184748/article/details/114115441
安装
开源安装脚本库:https://gitee.com/cunkai/HomebrewCN
复制以下内容到你的终端:
intel芯片:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
M1芯片:
/bin/zsh -c "$(curl -fsSL https://gitee.com/huwei1024/HomebrewCN/raw/master/Homebrew.sh)"
回车运行,按照提示运行下去就可以了
验证
brew -v
提示的2条git config命令也要执行才可以
rantichow@FrantiChowdeMac-mini sbin % brew -v
Homebrew >=2.5.0 (shallow or no git repository)
fatal: detected dubious ownership in repository at '/opt/homebrew/Homebrew/Library/Taps/homebrew/homebrew-core'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: detected dubious ownership in repository at '/opt/homebrew/Homebrew/Library/Taps/homebrew/homebrew-cask'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask (no Git repository)
frantichow@FrantiChowdeMac-mini sbin %
frantichow@FrantiChowdeMac-mini sbin % git config --global --add safe.directory /opt/homebrew/Homebrew/Library/Taps/homebrew/homebrew-core
frantichow@FrantiChowdeMac-mini sbin % git config --global --add safe.directory /opt/homebrew/Homebrew/Library/Taps/homebrew/homebrew-cask
frantichow@FrantiChowdeMac-mini sbin % brew -v
Homebrew >=2.5.0 (shallow or no git repository)
Homebrew/homebrew-core (git revision 5cef4c42a3f; last commit 2023-02-05)
Homebrew/homebrew-cask (git revision 7e620eb67d; last commit 2023-02-05)
frantichow@FrantiChowdeMac-mini sbin %

浙公网安备 33010602011771号