HomeBrew全新安装搜索不到库

2021-04-28  本文已影响0人  小强开学前

1. 安装

2. 配置正确的库

这时候安装一些不常见的库会出现No formulae found in taps.的报错
运行 brew doctor 发现默认安装的homebrew-coregit 地址不对

Warning: Suspicious https://github.com/Homebrew/homebrew-core git origin remote found.
The current git origin is:
  https://github.com/Homebrew/brew

With a non-standard origin, Homebrew won't update properly.
You can solve this by setting the origin remote:
  git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" remote set-url origin https://github.com/Homebrew/homebrew-core

按照提示输入上述命令,结果

Error: Fetching /usr/local/Homebrew failed!
/usr/local/Homebrew/Library/Homebrew/brew.sh: line 109: /usr/local/bin/brew: No such file or directory

发现 brew 命令不起作用了

下面尝试进入文件夹,强行更新homebrew-core文件夹

cd /usr/local/Homebrew/Library/Taps/homebrew/
rm -rf homebrew-core
git clone https://github.com/Homebrew/homebrew-core.git

brew 命令还是不行,一番查找发现是整个bin文件夹都没有了,一般来说这是启动文件所在的文件夹,安装的时候会释放,于是想到重装。

重新执行/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)",文件校验通过,没有重新下载,很快提示安装完成。

尝试brew doctor 显示Your system is ready to brew.

完成。

上一篇下一篇

猜你喜欢

热点阅读