只是想在 Mac 上用 wget

写在前面

最开始只是想在 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值