腾讯云服务器如何安装 zsh & oh-my-zsh(解决 github 连接问题)
1. 安装 zsh
sudo apt install zsh
2. 安装 oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
或者
sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
3. 如果有报错
1) 试试 github.com 和 githubusercontent.com 能否 ping 通
如果不行,看看全国哪个 IP 能 ping 通,记下来
https://ping.chinaz.com/github.com
https://ping.chinaz.com/raw.githubusercontent.com
修改 hosts 文件
sudo vim /etc/hosts
添加以下内容(换成可用的 IP)
20.205.243.166 github.com 185.199.108.133 raw.githubusercontent.com
2) 如果能连接,但连接不稳定会报错
将 http/2 降级至 http/1.1
git config --global http.version HTTP/1.1
如果连接又稳定了,恢复的方法是
git config --global --unset http.version
3)其他报错和问题找 DeepSeek


浙公网安备 33010602011771号