You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法通过官方脚本安装Oh My Zsh,连接raw.githubusercontent.com超时

解决Oh My Zsh安装时raw.githubusercontent.com连接超时问题

以下是几个可行的解决方案:

  • 修改本地hosts文件强制解析IP

    1. 查询raw.githubusercontent.com的有效公网IP(可通过本地nslookup raw.githubusercontent.com命令或IP查询服务获取最新可用IP)
    2. 编辑hosts文件:
      • Linux/macOS:执行sudo vim /etc/hosts
      • Windows:右键以管理员身份打开记事本,加载C:\Windows\System32\drivers\etc\hosts文件
    3. 在文件末尾添加一行(示例IP,需替换为最新有效IP):
      185.199.108.133 raw.githubusercontent.com
      
    4. 保存文件后刷新本地DNS缓存:
      • Linux:sudo systemd-resolve --flush-caches
      • macOS:sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
      • Windows:打开管理员命令提示符执行ipconfig /flushdns
    5. 重新运行Oh My Zsh的安装命令
  • 通过代理执行安装命令
    如果有可用的HTTP/HTTPS代理,在curl或wget命令中指定代理参数:

    • curl方式:
      sh -c "$(curl -fsSL -x http://代理地址:端口 https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
      
    • wget方式:
      sh -c "$(wget -e use_proxy=yes -e http_proxy=http://代理地址:端口 https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
      
  • 手动下载安装脚本执行

    1. 在能正常访问raw.githubusercontent.com的环境中,下载安装脚本:
      curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -o install.sh
      
    2. 将install.sh文件传输到目标机器(可通过U盘、SCP等方式)
    3. 给脚本添加执行权限:
      chmod +x install.sh
      
    4. 运行脚本完成安装:
      ./install.sh
      

内容的提问来源于stack exchange,提问作者Vishesh Mistry

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 21:55:26