用brew install corkcrew的时候出现以下问题:
zhaoqing.li@MBC02XC04EJGH7 ~ % brew install corkscrew
Warning: No available formula with the name "corkscrew".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
zhaoqing.li@MBC02XC04EJGH7 ~ % unset HOMEBREW_BREW_GIT_REMOTE
重新下载的时候发现,很多包都没装上:
Error: Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts failed!
fatal: Could not resolve HEAD to a revision
Failed during: /usr/local/bin/brew update --force --quiet
尝试了一下更新:
zhaoqing.li@MBC02XC04EJGH7 ~ % brew update -verbose
HOMEBREW_BREW_GIT_REMOTE set: using https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git for Homebrew/brew Git remote.
HOMEBREW_CORE_GIT_REMOTE set: using https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git for Homebrew/core Git remote.
Checking if we need to fetch /usr/local/Homebrew...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-versions...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found...
Checking if we need to fetch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
Updating /usr/local/Homebrew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Switched to and reset branch 'master'
Your branch is up to date with 'origin/master'.
Switched to and reset branch 'stable'
Current branch stable is up to date.
Updating /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core...
fatal: Could not resolve HEAD to a revision
Already up-to-date.
最后查看了一下,我下载的东西缺少文件:(大概问题出现在此)
zhaoqing.li@MBC02XC04EJGH7 ~ % brew -v
Homebrew 3.4.7
Homebrew/homebrew-core (no Git repository)
Homebrew/homebrew-cask (git revision 1a5fd61ce8; last commit 2022-04-19)
于是把homebrew删除之后重新下载:
zhaoqing.li@MBC02XC04EJGH7 ~ % open /usr/local
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
再输入brew install corkscrew还是有问题:
zhaoqing.li@MBC02XC04EJGH7 ~ % brew install corkscrew
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/corkscrew-
######################################################################## 100.0%
==> Pouring corkscrew-2.0.catalina.bottle.tar.gz
/usr/local/Cellar/corkscrew/2.0: 9 files, 42KB
==> Running `brew cleanup corkscrew`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
输入export HOMEBREW_NO_INSTALL_CLEANUP=TRUE就可以解决了
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
homebrew - 配置Homebrew不删除旧版本 - Thinbug