MacOS 安装、卸载Homebrew

Harriet ·
更新时间:2024-11-15
· 685 次阅读

MacOS 安装、卸载Homebrew

1. Homebrew官网地址
在这里插入图片描述
2. 安装:在终端中输入下列代码

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

3. 安装过程生成的代码
只是想记录一下,安装成功都会出现这些的

lorraine@192 ~ % /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew /usr/local/share/man/man1/brew.1 /usr/local/share/zsh/site-functions/_brew /usr/local/etc/bash_completion.d/brew /usr/local/Homebrew Press RETURN to continue or any other key to abort ==> Downloading and installing Homebrew... remote: Enumerating objects: 15, done. remote: Counting objects: 100% (15/15), done. remote: Compressing objects: 100% (15/15), done. remote: Total 131293 (delta 3), reused 7 (delta 0), pack-reused 131278 Receiving objects: 100% (131293/131293), 31.46 MiB | 23.00 KiB/s, done. Resolving deltas: 100% (96361/96361), done. From https://github.com/Homebrew/brew * [new branch] master -> origin/master * [new tag] 0.1 -> 0.1 * [new tag] 0.2 -> 0.2 * [new tag] 0.3 -> 0.3 * [new tag] 0.4 -> 0.4 * [new tag] 0.5 -> 0.5 * [new tag] 0.6 -> 0.6 * [new tag] 0.7 -> 0.7 * [new tag] 0.7.1 -> 0.7.1 * [new tag] 0.8 -> 0.8 * [new tag] 0.8.1 -> 0.8.1 * [new tag] 0.9 -> 0.9 * [new tag] 0.9.1 -> 0.9.1 * [new tag] 0.9.2 -> 0.9.2 * [new tag] 0.9.3 -> 0.9.3 * [new tag] 0.9.4 -> 0.9.4 * [new tag] 0.9.5 -> 0.9.5 * [new tag] 0.9.8 -> 0.9.8 * [new tag] 0.9.9 -> 0.9.9 * [new tag] 1.0.0 -> 1.0.0 * [new tag] 1.0.1 -> 1.0.1 * [new tag] 1.0.2 -> 1.0.2 * [new tag] 1.0.3 -> 1.0.3 * [new tag] 1.0.4 -> 1.0.4 * [new tag] 1.0.5 -> 1.0.5 * [new tag] 1.0.6 -> 1.0.6 * [new tag] 1.0.7 -> 1.0.7 * [new tag] 1.0.8 -> 1.0.8 * [new tag] 1.0.9 -> 1.0.9 * [new tag] 1.1.0 -> 1.1.0 * [new tag] 1.1.1 -> 1.1.1 * [new tag] 1.1.10 -> 1.1.10 * [new tag] 1.1.11 -> 1.1.11 * [new tag] 1.1.12 -> 1.1.12 * [new tag] 1.1.13 -> 1.1.13 * [new tag] 1.1.2 -> 1.1.2 * [new tag] 1.1.3 -> 1.1.3 * [new tag] 1.1.4 -> 1.1.4 * [new tag] 1.1.5 -> 1.1.5 * [new tag] 1.1.6 -> 1.1.6 * [new tag] 1.1.7 -> 1.1.7 * [new tag] 1.1.8 -> 1.1.8 * [new tag] 1.1.9 -> 1.1.9 * [new tag] 1.2.0 -> 1.2.0 * [new tag] 1.2.1 -> 1.2.1 * [new tag] 1.2.2 -> 1.2.2 * [new tag] 1.2.3 -> 1.2.3 * [new tag] 1.2.4 -> 1.2.4 * [new tag] 1.2.5 -> 1.2.5 * [new tag] 1.2.6 -> 1.2.6 * [new tag] 1.3.0 -> 1.3.0 * [new tag] 1.3.1 -> 1.3.1 * [new tag] 1.3.2 -> 1.3.2 * [new tag] 1.3.3 -> 1.3.3 * [new tag] 1.3.4 -> 1.3.4 * [new tag] 1.3.5 -> 1.3.5 * [new tag] 1.3.6 -> 1.3.6 * [new tag] 1.3.7 -> 1.3.7 * [new tag] 1.3.8 -> 1.3.8 * [new tag] 1.3.9 -> 1.3.9 * [new tag] 1.4.0 -> 1.4.0 * [new tag] 1.4.1 -> 1.4.1 * [new tag] 1.4.2 -> 1.4.2 * [new tag] 1.4.3 -> 1.4.3 * [new tag] 1.5.0 -> 1.5.0 * [new tag] 1.5.1 -> 1.5.1 * [new tag] 1.5.10 -> 1.5.10 * [new tag] 1.5.11 -> 1.5.11 * [new tag] 1.5.12 -> 1.5.12 * [new tag] 1.5.13 -> 1.5.13 * [new tag] 1.5.14 -> 1.5.14 * [new tag] 1.5.2 -> 1.5.2 * [new tag] 1.5.3 -> 1.5.3 * [new tag] 1.5.4 -> 1.5.4 * [new tag] 1.5.5 -> 1.5.5 * [new tag] 1.5.6 -> 1.5.6 * [new tag] 1.5.7 -> 1.5.7 * [new tag] 1.5.8 -> 1.5.8 * [new tag] 1.5.9 -> 1.5.9 * [new tag] 1.6.0 -> 1.6.0 * [new tag] 1.6.1 -> 1.6.1 * [new tag] 1.6.10 -> 1.6.10 * [new tag] 1.6.11 -> 1.6.11 * [new tag] 1.6.12 -> 1.6.12 * [new tag] 1.6.13 -> 1.6.13 * [new tag] 1.6.14 -> 1.6.14 * [new tag] 1.6.15 -> 1.6.15 * [new tag] 1.6.16 -> 1.6.16 * [new tag] 1.6.17 -> 1.6.17 * [new tag] 1.6.2 -> 1.6.2 * [new tag] 1.6.3 -> 1.6.3 * [new tag] 1.6.4 -> 1.6.4 * [new tag] 1.6.5 -> 1.6.5 * [new tag] 1.6.6 -> 1.6.6 * [new tag] 1.6.7 -> 1.6.7 * [new tag] 1.6.8 -> 1.6.8 * [new tag] 1.6.9 -> 1.6.9 * [new tag] 1.7.0 -> 1.7.0 * [new tag] 1.7.1 -> 1.7.1 * [new tag] 1.7.2 -> 1.7.2 * [new tag] 1.7.3 -> 1.7.3 * [new tag] 1.7.4 -> 1.7.4 * [new tag] 1.7.5 -> 1.7.5 * [new tag] 1.7.6 -> 1.7.6 * [new tag] 1.7.7 -> 1.7.7 * [new tag] 1.8.0 -> 1.8.0 * [new tag] 1.8.1 -> 1.8.1 * [new tag] 1.8.2 -> 1.8.2 * [new tag] 1.8.3 -> 1.8.3 * [new tag] 1.8.4 -> 1.8.4 * [new tag] 1.8.5 -> 1.8.5 * [new tag] 1.8.6 -> 1.8.6 * [new tag] 1.9.0 -> 1.9.0 * [new tag] 1.9.1 -> 1.9.1 * [new tag] 1.9.2 -> 1.9.2 * [new tag] 1.9.3 -> 1.9.3 * [new tag] 2.0.0 -> 2.0.0 * [new tag] 2.0.1 -> 2.0.1 * [new tag] 2.0.2 -> 2.0.2 * [new tag] 2.0.3 -> 2.0.3 * [new tag] 2.0.4 -> 2.0.4 * [new tag] 2.0.5 -> 2.0.5 * [new tag] 2.0.6 -> 2.0.6 * [new tag] 2.1.0 -> 2.1.0 * [new tag] 2.1.1 -> 2.1.1 * [new tag] 2.1.10 -> 2.1.10 * [new tag] 2.1.11 -> 2.1.11 * [new tag] 2.1.12 -> 2.1.12 * [new tag] 2.1.13 -> 2.1.13 * [new tag] 2.1.14 -> 2.1.14 * [new tag] 2.1.15 -> 2.1.15 * [new tag] 2.1.16 -> 2.1.16 * [new tag] 2.1.2 -> 2.1.2 * [new tag] 2.1.3 -> 2.1.3 * [new tag] 2.1.4 -> 2.1.4 * [new tag] 2.1.5 -> 2.1.5 * [new tag] 2.1.6 -> 2.1.6 * [new tag] 2.1.7 -> 2.1.7 * [new tag] 2.1.8 -> 2.1.8 * [new tag] 2.1.9 -> 2.1.9 * [new tag] 2.2.0 -> 2.2.0 * [new tag] 2.2.1 -> 2.2.1 * [new tag] 2.2.2 -> 2.2.2 * [new tag] 2.2.3 -> 2.2.3 * [new tag] 2.2.4 -> 2.2.4 * [new tag] 2.2.5 -> 2.2.5 HEAD is now at 11bdacf1b Merge pull request #7035 from issyl0/bump-formula-pr-fix-unbottled-linux-only-formulae ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Tapping homebrew/core Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'... remote: Enumerating objects: 5129, done. remote: Counting objects: 100% (5129/5129), done. remote: Compressing objects: 100% (4929/4929), done. remote: Total 5129 (delta 43), reused 323 (delta 5), pack-reused 0 Receiving objects: 100% (5129/5129), 4.16 MiB | 11.00 KiB/s, done. Resolving deltas: 100% (43/43), done. Tapped 4913 formulae (5,171 files, 12.8MB). Already up-to-date. ==> 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 ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Next steps: - Run `brew help` to get started - Further documentation: https://docs.brew.sh lorraine@192 ~ %

4. 安装成功标志
在这里插入图片描述
5. 卸载:与安装代码只有“install”和"uninstall"的区别

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

6. 如果安装过程中出现错误,可以尝试执行卸载代码试试再进行安装,要是还不行,再参考下面的方法吧(小白膜拜中……)
Homebrew安装、卸载、可能的报错及解决方案_Mac
7. 常用命令

brew search # 搜索 brew install # 安装一个软件 brew uninstall # 卸载一个软件 brew update # 从服务器上拉取,并更新本地 brew 的包目录 brew upgrade # 更新一个软件 brew upgrade # 更新全部已安装软件 brew outdated # 查看你的软件中哪些有新版本可用 brew cleanup # 清理老版本。使用 "-n" 参数,不会真正执行,只是打印出真正运行时会做什么。 brew list --versions # 查看你安装过的包列表(包括版本号) brew link # 将软件的当前最新版本软链到"/usr/local"目录下 brew unlink # 将软件在"/usr/local"目录下的软链接删除。 brew info # 显示软件的信息 brew deps # 显示包依赖 brew doctor # 检查brew软件的安装是否正常 brew prune # 移除链接失效的文件 brew --cache # 打印下载软件的缓存路径 brew --config # 打印brew的配置信息 brew --env # 打印brew的环境信息 brew --prefix # 打印prefix的路径(通常是/usr/local/) brew --prefix [formula] # 指出formula安装位置

在终端里操作总感觉好酷啊,哈哈哈哈


作者:Lorraine_LY



macOS homebrew 安装

需要 登录 后方可回复, 如果你还没有账号请 注册新账号
相关文章