有趣生活

当前位置:首页>科技>mac的brew如何安装HomeBrew安装慢解决方案

mac的brew如何安装HomeBrew安装慢解决方案

发布时间:2026-07-25阅读(1)

导读网速快可使用此方法官网安装Homebrew/usr/bin/ruby-e“$(curl-fsSLhttps://raw.githubusercontent.....

网速快可使用此方法官网安装Homebrew/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”,今天小编就来说说关于mac的brew如何安装?下面更多详细答案一起来看看吧!

mac的brew如何安装(HomeBrew安装慢解决方案)

mac的brew如何安装

网速快可使用此方法官网安装Homebrew

/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

慢的看这里,先获取install文件 curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

并保存名为 brew_install

打开 brew_install 文件,修改如下:

找到如下代码:

BREW_REPO = “https://github.com/Homebrew/brew“.freeze

CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core“.freeze

复制代码更改为:

BREW_REPO = “https://mirrors.ustc.edu.cn/brew.git “.freeze

CORE_TAP_REPO = “https://mirrors.ustc.edu.cn/homebrew-core.git“.freeze

注意:

新版本HomeBrew可能没有CORE_TAP_REPO这句代码,如果没有不用新增。

执行脚本

/usr/bin/ruby brew_install

此时脚本应该停在

==> Tapping homebrew/core

Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…

解决方法,手动执行下面这句命令,更换为中科院的镜像:

git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

复制代码然后把homebrew-core的镜像地址也设为中科院的国内镜像

cd $(brew --repo)

git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"

git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

复制代码执行更新,成功:

brew update

复制代码最后用这个命令检查无错误:

brew doctor

复制代码至此HomeBrew就安装完成了。

TAGS标签:  brew  如何  安装  homebrew  mac的brew如何  安装HomeBrew

Copyright © 2024 有趣生活 All Rights Reserve吉ICP备19000289号-5 TXT地图HTML地图XML地图