天天看點

Mac安裝zshMac安裝zsh

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方式

可以自行選擇适合自己的安裝方式。