Loading... # 简介 ![][1] macOS的软件包安装管理器。这个管理器基于Ruby和Git来实现。 通过Homebrew安装的软件都会集中在一个目录下面,再由 Homebrew 将相关软件软链接到相关路径。Homebrew意思是啤酒。而Cellar的意思是酒窖,因此软件下载目录为`/usr/local/Cellar/`。 这些软件在安装后其中的文件会使用软链接到`/usr/local/bin`(存放二进制文件) 以及 `/usr/local/share`(存放文档) 下。 ---------- # 安装 首先安装 Command line Tool (CLT),此工具会安装一系列常用的软件。比如git gcc等。 ```sh sudo xcode-select --install ``` 它的安装路径为/Library/Developer/CommandLineTools 卸载方法 ```sh rm -rf /Library/Developer/CommandLineTools ``` Homebrew安装命令 ```sh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ---------- # 使用 软件有两种 一个是不含图形界面的 `formula` 一个是包含图形界面的 `cask`。 | 命令 | 功能 | ----- | ------ | brew list | 查看已经安装的软件 | | brew list --cask | 查看已经安装的软件-仅包括图形界面 | | brew leaves | 查看已经安装的软件-去除依赖 | | brew search `软件` | 搜索软件 | | brew install `软件` | 安装软件 | | brew uninstall `软件` | 卸载软件| | brew info `软件` | 查看软件的信息 | | brew update | 更新所有软件以及软件本身 | | brew upgrade | 更新某个软件 | | brew autoremove | 自动删除不需要的依赖 | | brew autoremove -n | 显示不需要的依赖,| | brew doctor | 诊断错误 | | brew link --overwrite -f `软件` | 软连接,在安装软件时会自动执行此条命令 | ---------- # 必装软件 ### formula * fish 一种shell * wget * node@14 node npm支持 * neofetch 查看系统简单信息 ### cask * mounty 提供ntfs支持的软件 * qlstephen 预览加强插件 [1]: https://assets.fangshirui.cn/typecho/uploads/2020/11/2402052753.png 最后修改:2020 年 12 月 10 日 08 : 06 PM © 允许规范转载