写在前面
最开始只是想在 Mac 上用 wget 方便下载东西,无奈得特意安装。所以先装了 homebrew 再装 wget。
按道理来讲,homebrew 本身非常方便,无奈墙人所难。所以需要用镜像安装和配置 homebrew,再安装 wget 就很方便了。
安装 homebrew
原本命令超级简单,但是下载不下来呢……所以需要镜像,这样就很方便了。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
代码摘录:
xcode-select --install
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git brew-install
/bin/bash brew-install/install.sh
rm -rf brew-install
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
brew update
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
brew tap --custom-remote --force-auto-update homebrew/cask-drivers https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
brew update
安装 wget
首先 update,很好上来就失败了呢😄
brew update
# error: Not a valid ref: refs/remotes/origin/master
# fatal: Could not resolve HEAD to a revision
# Already up-to-date.
看一下具体节点吧
brew update --verbose
# balabalabala
# Updating /opt/homebrew/Library/Taps/homebrew/homebrew-core...
# fatal: Could not resolve HEAD to a revision
去到这个路径下面看一看
cd /opt/homebrew/Library/Taps/homebrew/homebrew-core
ls -al
git fetch --prune origin
git pull --rebase origin master
# pulling
# From https://mirrors.ustc.edu.cn/homebrew-core
# * branch master -> FETCH_HEAD
# 成功之后,就可以 brew update,然后再装 wget 或者其他包包
brew update
brew install wget