最近在安装homebrew的时候,遇到了一些问题,在这记录一下
homebrew 官网:https://brew.sh/index_zh-cn.html
1.将官网的安装脚本拷贝下来(脚本已经上传,链接:https://download.youkuaiyun.com/download/hello_levy/12288823)
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh >> brew_install.sh
2.打开脚本
open brew_install.sh
3.替换镜像
BREW_REPO = “https://github.com/Homebrew/brew“
替换为 =>
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
4.运行脚本
sh brew_install.sh
5.如果出现以下情况,说明源不通,换源
==> 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
cd "$(brew --repo)"
sudo git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
我只换到这里,有些教程换到了homebrew-core文件夹下,我并没有,所以没有操作,不影响后面进行。
6.更新brew
brew update
出现Already up-to-date则表示成功
7. 安装wget
brew install wget

查看是否安装成功以及用法
wget --help

本文介绍了如何在Mac上安装Homebrew,包括从官网获取安装脚本,替换国内镜像以解决安装速度慢的问题,以及后续安装wget的步骤。遇到安装源不通的情况,提供了换源建议,并验证了brew的安装成功。
1万+

被折叠的 条评论
为什么被折叠?



