mac安装brew遇到的一些问题

作者 : admin 本文共1884个字,预计阅读时间需要5分钟 发布时间: 2024-06-9 共3人阅读

@

  1. mac终端执行命令/bin/bash -c “$(curl -fsSL http://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 ‘http://​​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)浏览器访问​​http://www.ipaddress.com​​,进入如下页面
    mac安装brew遇到的一些问题插图

2)页面下拉到如图位置,输入域名,点击搜索
mac安装brew遇到的一些问题插图(1)

浏览器滚动至接近最下方,利用终端ping搜索到的ip,要ping通
mac安装brew遇到的一些问题插图(2)

3)在/etc/hosts中添加ip映射,如果映射的ip不对,则会提示超时等连接错误信息
mac安装brew遇到的一些问题插图(3)

  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 http://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 ​​http://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 ​​http://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)”​​

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

本站无任何商业行为
个人在线分享 » mac安装brew遇到的一些问题
E-->