Homebrew
homebrew
更多more
Homebrew是一款包管理工具,主要由④ 部分组成:brew、homebrew-core、homebrew-cask、homebrew-bottles
名称 | 说明 |
---|---|
brew | Homebrew 源代码仓库 |
homebrew-core | Homebrew 核心源 |
homebrew-cask | 提供 macOS 应用和大型二进制文件的安装 |
homebrew-bottles | 预编译二进制软件包 |
安装homebrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
或者
脚本内置中科大的镜像源
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
-
如果命令卡在下面信息
==> Tapping homebrew/core Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
或者查看
/usr/local/Homebrew/Library/Taps/homebrew
下面没有homebrew-core
文件夹, 手动克隆cd "$(brew --repo)/Library/Taps/" mkdir homebrew && cd homebrew git clone git://mirrors.ustc.edu.cn/homebrew-core.git
-
安装
cask
同样也有安装失败或者卡住的问题,解决方法也是一样:cd "$(brew --repo)/Library/Taps/" cd homebrew git clone https://mirrors.ustc.edu.cn/homebrew-cask.git
-
成功执行之后继续执行安装命令。
最后看到
==> Installation successful!
就说明安装成功了。最最后更新下:
brew update
查看当前源
-
brew源
cd "$(brew --repo)" && git remote -v
-
homebrew-core
cd "$(brew --repo homebrew/core)" && git remote -v
-
home-bottles
查看Mac终端shell类型是bash还是zsh
echo $SHELL > /bin/bash # bash > /bin/zsh # zsh
切换shell类型
- 切换到bash:
chsh -s /bin/bash
- 切换到zsh:
chsh -s /bin/zsh
- 切换到bash:
-
home-cash
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask" && git remote -v
换源
git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
brew update
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles' >> ~/.zprofile
source ~/.zprofile
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了