Mac安装zsh
官方地址:https://ohmyz.sh/
安装的准备
在安装zsh前先进行curl和wget的安装,在安装的过程中发现一堆报错
Permission denied
。
更改权限
# 下面这条命令会执行失败:chown: /usr/local: Operation not permitted
# sudo chown -R $(whoami):admin /usr/local
# 这些会执行成功
sudo chown -R $(whoami):admin /usr/local/Cellar
sudo chown -R $(whoami):admin /usr/local/Homebrew
sudo chown -R $(whoami):admin /usr/local/lib
然后根据命令行提示信息依次安装curl和wget:
brew install curl
和
brew install wget
。
安装方式
1.curl方式安装
安装过程发现报错如下:
fatal: unable to access 'https://github.com/ohmyzsh/ohmyzsh.git/': Failed to connect to github.com port 443: Operation timed out
Error: git clone of oh-my-zsh repo failed
然后注释掉
/etc/hosts
中
github.com
相关的解析记录,重新执行命令,发现报错如下:
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443
切换国内源:
2.wget方式安装
3.brew方式
可以自行选择适合自己的安装方式。