homebrew 常用命令

1. brew 简介
2. 常用命令
3. 镜像配置

1. brew 简介

使用 brew 安装的软件,其安装位置和配置文件都存放在固定的目录

安装位置: /opt/homebrew/Cellar

配置文件: /opt/homebrew/etc

2. 常用命令

基础命令

命令 描述
brew -v 查看当前 homebrew 版本号
brew list 列出已安装的软件
brew search 关键字 根据关键字查找可安装的软件
brew outdated 查看可更新的软件
brew info softwareName 查看某个软件的详细信息
brew upgrade softwareName 升级某个软件的详细信息
brew install、brew uninstall

brew install redis
brew install nginx
brew install php@7.2
// 卸载通过brew install安装的软件
brew uninstall redis
brew serivces 命令

brew serivces 命令是专门用来管理通过 homebrew 安装的各类服务的

// 查看所有服务及它们各自的运行状态
brew services list
// 启动服务
brew services start redis
// 停止服务
brew services stop redis
// 重启服务
brew services restart redis
3. 镜像配置

查看镜像配置

 

阿里云镜像配置 (zsh 终端)

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 应用生效
brew update
# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc

posted @ 2022-12-27 21:02  很酷的站长  阅读(729)  评论(0编辑  收藏  举报
70博客 AI工具 源码下载