当前位置: 首页> 健康> 知识 > mac安装brew遇到的一些问题

mac安装brew遇到的一些问题

时间:2025/7/12 5:37:16来源:https://blog.csdn.net/qq_43251032/article/details/139544299 浏览次数:0次

@

  1. mac终端执行命令/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”,无法建立连接或连接超时错误,错误信息如下:
    curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 75059 ms: Couldn’t connect to server
    fatal: unable to access ‘https://​​github​​.com/Homebrew/brew/’: Failed to connect to github.com port 443: Operation timed out
    Failed to connect to raw.githubusercontent.com port 443: Connection refused
    解决:
    1)浏览器访问​​https://www.ipaddress.com​​,进入如下页面
    在这里插入图片描述

2)页面下拉到如图位置,输入域名,点击搜索
在这里插入图片描述

浏览器滚动至接近最下方,利用终端ping搜索到的ip,要ping通
在这里插入图片描述

3)在/etc/hosts中添加ip映射,如果映射的ip不对,则会提示超时等连接错误信息
在这里插入图片描述

  1. 长时间卡在 Downloading Command Line Tools for Xcode
    解决:
    1)终端输入:xcode-select --install
    2)mac根据提示在接通电源的情况下安装xcode-select

  2. xcode-select: note: Command line tools are already installed. Use “Software Update” in System Settings or the softwareupdate command line interface to install updates
    解决:
    1)终端输入sudo xcode-select -p 查看xcode-select位置(默认在/Library/Developer/CommandLineTools)
    2)删除xcode-select:sudo rm -rf /Library/Developer/CommandLineTools
    3)重装xcode-select:xcode-select --install

  3. error: 835 bytes of body are still expected96 MiB | 46.00 KiB/s
    fetch-pack: unexpected disconnect while reading sideband packet
    fatal: early EOF
    fatal: fetch-pack: invalid index-pack output
    Failed during: /usr/bin/git fetch --force origin
    解决:
    终端输入:git config --global http.postBuffer 524288000
    此时仍提示错误:Error: Failed to download https://formulae.brew.sh/api/formula.jws.json!
    Failed during: /opt/homebrew/bin/brew update --force --quiet
    如果还出现错误,建议删除homebrew并重新安装

用国内镜像源:
删除:/bin/zsh -c " ( c u r l − f s S L ​​ h t t p s : / / g i t e e . c o m / c u n k a i / H o m e b r e w C N / r a w / m a s t e r / H o m e b r e w U n i n s t a l l . s h ) " ​​安装: / b i n / z s h − c " (curl -fsSL ​​https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"​​ 安装:/bin/zsh -c " (curlfsSL​​https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"​​安装:/bin/zshc"(curl -fsSL ​​https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"​​

以上创作全凭经历回忆,希望能够帮助到您。本人从事软件开发有5年多的时间了,现在真的好想自主创业,可没人脉没资源的自己难免产生着很多焦虑,这里希望同行的你能带给我一点鼓励,让我能在软件这行继续坚持下去。同时个人整理了一些主流平台的学习资源,需要者联系
在这里插入图片描述

关键字:mac安装brew遇到的一些问题

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: