MacOS安装brew
背景
心血来潮想写点blog,一个tree命令给我折腾崩溃了,生成一个文件树结构咋就这么难!
python没有库一键打印,linux或者macos可以用tree命令,但是macos它默认咋没有呢!
是的,写这篇文章的时候,我已经把电脑都重置了。。。
坑们
第一坑·brew
理想情况下brew install tree
就安上了,可是我没有brew!
第二坑·安装brew
好,没有brew,我来安一下,kiwi告诉我用git命令clone,可是丫也没有git啊
git咋装,嗯xcode装了之后就有git可以用了,xcode这玩意可大啊,装起来费劲的很
出坑·国内源安装brew
就在我git装好了,准备安装brew之际,达模型突然开窍了,直接用国内源的brew安装脚本不就行了么
(base) zhangjian@ZhangJiandeMacBook-Air mac - 数据 % /bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> You are using macOS 10.15.
==> We (and Apple) do not provide support for this old version.
因为系统版本,可能会遇到一些未知问题
==> 安装提示
Mac下镜像飞速安装Homebrew教程(请收藏):https://brew.idayer.com/
打个小广告
欢迎使用[快系列]教程,必出精品,安装有保障!
- [快系列]stable-diffusion-webui: https://brew.idayer.com/install/stable-diffusion-webui
- [快系列]nvm快速安装教程: https://brew.idayer.com/install/nvm-for-nodejs
安装遇到问题,请添加讨论群寻求Homebrew的安装帮助。
当然也非常欢迎大家加群聊天摸鱼,讨论mac、软件、摄影,扫码关注公众号:湖中剑,回复'brew'加群。
█████████████████████████████████████
█████████████████████████████████████
████ ▄▄▄▄▄ █▀█ █▄▀▄ ▄ ▄▄██ ▄▄▄▄▄ ████
████ █ █ █▀▀▀█ ▀█▀▀▀▀▄▀█ █ █ ████
████ █▄▄▄█ █▀ █▀▀█▄▀ █▀▄ █ █▄▄▄█ ████
████▄▄▄▄▄▄▄█▄▀ ▀▄█▄▀ █▄▀ █▄▄▄▄▄▄▄████
████ ▀▄▄▄▄▀▄▀▄▄█▀▀█ █ ▀ ▀▄█▄▀████
████ ▀█▄▀▀▄ █▄█▀█ ▄██ █ ▀ ▄▄██▀█████
████ █ █▄ ▄ ▄█▄ ▀ ██ ▀ ▀▀▀▄ █▀████
████ ██▄██▄▀ █ ▄█▀ ▄▄▀▀ ▀ █▄█▄▀█████
████ ▄ ▀▄▄▄▀█▄ ▄▀ ▀ ▀█▀ ▀▀ █▀████
████ █ ▀▀▀▄█▄█▄█▀█▀▄ █▀▀▄▄█▄▄▄▄▀█████
████▄██▄▄█▄█▀▀▀█▄█▄ ▀▄▀█ ▄▄▄ ▀ ████
████ ▄▄▄▄▄ █▄▀ ▄█▄ ▄▀ █▄█ ▄▀█████
████ █ █ █ ▀▄▄ ▀▄ ▀███ ▄▄▄▄ ▄▀ ████
████ █▄▄▄█ █ ▄▄▀ ██▄▀▄▀▄ ▀▄ ▄ █████
████▄▄▄▄▄▄▄█▄▄█▄▄████▄█████▄▄█▄██████
█████████████████████████████████████
█████████████████████████████████████
请按回车键(RETURN)继续安装,按其他任意按键取消安装
==> /usr/bin/sudo /usr/sbin/chown -R zhangjian:admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
remote: Enumerating objects: 307886, done.
remote: Counting objects: 100% (95978/95978), done.
remote: Compressing objects: 100% (11539/11539), done.
remote: Total 307886 (delta 94535), reused 84483 (delta 84439), pack-reused 211908
Receiving objects: 100% (307886/307886), 92.05 MiB | 12.10 MiB/s, done.
Resolving deltas: 100% (221515/221515), done.
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (35/35), done.
remote: Total 55 (delta 35), reused 35 (delta 35), pack-reused 20
Unpacking objects: 100% (55/55), done.
HOMEBREW_BREW_GIT_REMOTE set: using https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git as the Homebrew/brew Git remote.
==> Updating Homebrew...
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/bottles-portable-ruby/portable-ruby-3.4.5.el_capitan.bottle.tar.gz
################################################################################ 100.0%
==> Pouring portable-ruby-3.4.5.el_capitan.bottle.tar.gz
==> Installation successful!
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Next steps:
自动配置环境变量
执行成功
重要信息!!!重要信息!!!重要信息!!!
如果遇到 command not found brew,请执行下面脚本完成安装或者直接重新打开终端:
eval "$(/usr/local/bin/brew shellenv)"
==> 🎉 恭喜,安装成功!
- 验证命令: brew help
- 请收藏,谨防失联: https://brew.idayer.com
==> 如果有幸帮助到你,可以考虑请我喝杯咖啡~
☕ 喝咖啡:https://brew.idayer.com/reward/
(base) zhangjian@ZhangJiandeMacBook-Air mac - 数据 % brew --version
Homebrew 4.6.3
(base) zhangjian@ZhangJiandeMacBook-Air mac - 数据 % brew install tree
==> Downloading https://formulae.brew.sh/api/formula.jws.json
==> Downloading https://formulae.brew.sh/api/cask.jws.json
Warning: You are using macOS 10.15.
We (and Apple) do not provide support for this old version.
This is a Tier 3 configuration:
https://docs.brew.sh/Support-Tiers#tier-3
You can report Tier 3 unrelated issues to Homebrew/* repositories!
Read the above document instead before opening any issues or PRs.
==> Fetching downloads for: tree
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/1fc8ebc234f37e
################################################################################ 100.0%
==> Fetching tree
==> Downloading https://github.com/Old-Man-Programmer/tree/archive/refs/tags/2.2.1.tar.
==> Downloading from https://codeload.github.com/Old-Man-Programmer/tree/tar.gz/refs/ta
-#O=# # #
==> make PREFIX=/usr/local/Cellar/tree/2.2.1 MANDIR=/usr/local/Cellar/tree/2.2.1/share/
🍺 /usr/local/Cellar/tree/2.2.1: 9 files, 186.2KB, built in 19 seconds
==> Running `brew cleanup tree`...
Disable this behaviour by setting `HOMEBREW_NO_INSTALL_CLEANUP=1`.
Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
==> No outdated dependents to upgrade!
(base) zhangjian@ZhangJiandeMacBook-Air mac - 数据 % tree
.
└── 未命名文件夹
├── Miniconda3-latest-MacOSX-x86_64.sh
└── PyCharm 2022.2.4 (intel芯片)Mac.dmg
2 directories, 2 files
(base) zhangjian@ZhangJiandeMacBook-Air mac - 数据 % ls
未命名文件夹
至此完成!
总结
brew安装直接使用国内源的脚本!