Homebrew 安装与卸载

本文提供了两种Homebrew的安装方法,推荐使用科大源进行快速安装,而官方安装可能需要配置Host。卸载Homebrew有对应的脚本,如果遇到问题,如网络连接失败,可能需要检查网络或手动替换资源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装方式一(推荐):(使用 科大源 进行安装)

安装

$ /bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"

卸载

$ /bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/uninstall.sh)"
  • 如果报错 Error: No similarly named formulae found.,则更换一下 homebrew-core 文件即可,如果 git clone 的方式慢,也可以直接打开链接进行下载,将下载的文件夹改成 homebrew-core 替换掉之前的 homebrew-core 文件即可。
$ cd /usr/local/Homebrew/Library/Taps/homebrew/
$ rm -rf homebrew-core
$ git clone https://github.com/Homebrew/homebrew-core.git

安装方式二:(完全纯官方安装,但是需要配置 host,githubusercontent 国内访问不了)

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

安装报错这个,试试连接梯子:

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection reset by peer

卸载

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"

卸载过程中根据提示进行操作

aaMacBook-Pro: $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Warning: This script will remove:
/Users/dengzemiao/Library/Caches/Homebrew/
/usr/local/Caskroom/
/usr/local/Cellar/
/usr/local/bin/brew -> /usr/local/bin/brew
Are you sure you want to uninstall Homebrew? This will remove your installed packages! [y/N] 
......

参考:https://zhuanlan.zhihu.com/p/111014448

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值