MacOS 重装Homebrew
莫名其妙的,我的Homebrew挂了。
然后又到了欢乐的重装时刻。(恼
根据官方的文档,卸载指令如下:或者戳这里
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
然后我这里就报错了,原因是被墙了,报错如下
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 4 ms: Connection refused
报错解决方案:(这个指令就是临时改一下这个终端的环境,具体我也不是很懂)
# 把下面的端口号改成自己的(前提是需要有VPN)
export https_proxy=http://localhost:58591/ http_proxy=http://localhost:58591/ all_proxy=socks5://localhost:51837/
如果不知道这几个端口号是啥,可以参考一下我这里的端口号
然后就能看到正常的删除啦
(base) qry@qry-MacBook-Pro ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
Warning: This script will remove:
/Users/qry/Library/Caches/Homebrew/
/opt/homebrew/.dockerignore
/opt/homebrew/.editorconfig
.... 此处省略一大堆东西
/opt/homebrew/sbin/
/opt/homebrew/share/
/opt/homebrew/var/
You may wish to remove them yourself.
注意不要关掉这个终端,不然有可能安装的时候又被墙了(恼
接下来就是安装的过程了,按照官方文档,指令如下
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
正常安装应该长这样:
(base) qry@qry-MacBook-Pro ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
.... 此处省略一大堆东西
==> Next steps:
- Run brew help to get started
- Further documentation:
https://docs.brew.sh
下载个软件试试。
brew install --cask eul
嗨害嘿,成功了
(base) qry@qry-MacBook-Pro ~ % brew install --cask eul
==> Tapping homebrew/cask
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 679534, done.
remote: Counting objects: 100% (114/114), done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 679534 (delta 74), reused 79 (delta 41), pack-reused 679420
Receiving objects: 100% (679534/679534), 320.42 MiB | 7.84 MiB/s, done.
Resolving deltas: 100% (482356/482356), done.
Tapped 4093 casks (4,165 files, 342MB).
==> Downloading https://github.com/gao-sun/eul/releases/download/v1.6.2/eul.app.
==> Downloading from https://objects.githubusercontent.com/github-production-rel
######################################################################## 100.0%
==> Installing Cask eul
==> Moving App 'eul.app' to '/Applications/eul.app'
🍺 eul was successfully installed!
参考文献: