homebrew cask
如果我想安装Chrome浏览器怎么办?试试下面的命令:
brew install google-chrome发现并不能安装,没有该软件。怎么办?好消息是一个叫做homebrew-cask的工具扩充了homebrew。
Homebrew cask 软件仓库,提供 macOS 应用和大型二进制文件
安装
brew install caskroom/cask/brew-cask使用
基本用法与brew相同,只不过在brew后面加了一个cask单词。
安装软件
brew cask install google-chrome卸载软件
brew cask uninstall google-chromehomebrew services
如果我们使用homebrew安装了mysql等服务我们如何来管理呢?
Homebrew Services是一套可以通过 launchctl来管理安装的服务的套件
macOS使用launchctl命令加载开机自动运行的服务,brew service可以简化lauchctl的操作。
以MySQL为例,使用launchctl启动:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist如使用brew service可以简化为:
brew services start mysql安装
brew install services⚠️实际上homebrew services会在运行时自动安装
使用(都以mysql为例)
查看所有命令
brew servicesstart
登录时启动mysql服务
brew services start mysql在启动时启动Dnsmasq服务
sudo brew services start dnsmasq启动所有可用的服务
brew services start --allrun
运行服务,但不要在登录时启动它
brew services run mysqlstop
停止服务
brew services stop mysqlrestart
重启服务
brew services restart mysqllist
列出homebrew services管理的所有服务(查看使用homebrew安装的所有服务的列表)
brew services listcleanup
删除所有未使用的服务
brew services cleanup参考
homebrew-services










