1、下载item2
2、安装homebrew
默认安装脚本
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果你等待一段时间之后遇到下面提示,就说明无法访问官方脚本地址:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out
这个时候你执行下面的命令就可以了:(需要等待一会,别着急)
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
切记在终端执行环境变量设置!,如已执行过请忽略。
- 执行下面命令将 Homebrew 到 PATH 中:
// 先执行
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/jhh/.zprofile
再执行
eval "$(/opt/homebrew/bin/brew shellenv)"
// 最后:
brew -v
3、验证brew
brew -v
4、安装oh-my-zsh
// via curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
// via wget
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
// 或者git
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
2022-12-10更新国内安装方式:
// via curl
sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"
// via wget
sh -c "$(wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh -O -)"
新方式:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"