Mac brew 安装软件

Mac brew 安装软件

homebrew 速度慢

将brew 切换到国内镜像源

sh 复制代码
# 速度一般
# 步骤一
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

# 步骤二
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

#步骤三
brew update
sh 复制代码
# 速度比较快
# 替换 Homebrew
git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git

# 替换 Homebrew Core
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

# 替换 Homebrew Cask
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

# 替换 Homebrew-bottles
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc

brew update

注意这里需要等待一会,因为要更新资源。

更新完后使用brew update,brew install速度变快很多了,不会卡在那半天没动静,替换镜像完成。

复原方法

sh 复制代码
# 步骤一
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

# 步骤二
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core

#步骤三
brew update
Brew 几个常用的命令
sh 复制代码
#查看homebrew版本
brew -v

#查看已安装的包
brew list

#安装包
brew install packageName

#卸载包
brew uninstall packageName

#查找包
brew search packageName

#查看包信息
brew info packageName 

#更新homebrew
brew update

#诊断homebrew
brew doctor

#查看帮助信息
brew -h
安装redis
sh 复制代码
brew install redis

brew services start redis

#进入brew安装根目录
cd "$(brew --repo)"
/opt/homebrew

#默认安装目录
/opt/homebrew/opt/redis
#配置放到文件
/opt/homebrew/etc/redis.conf

重启redis服务:
brew servcies restart redis
安装Rabbitmq

参考

卸载重置安装rabbitmq报错

由于目录权限的问题导致启动不成功

复制代码
cd /opt/homebrew/var/lib/rabbitmq/mnesia

ls -l # 查看目录的权限, 非当前用户拥有目录则进行删除

rabbit@localhost rabbit@localhost-feature_flags rabbit@localhost-plugins-expand
相关推荐
hanjq_code2 天前
Mac电脑ROG键盘蓝牙模式下 Caps Lock 键无法切换语言的解决办法
mac
A懿轩A3 天前
【2026 最新】JDK 下载与安装:在 macOS 下使用 Homebrew 和 jenv 完美管理多版本 JDK
java·开发语言·jdk·mac
A懿轩A4 天前
【2026 最新】Python 下载与安装:在 macOS 下使用 Homebrew 和 pyenv 完美管理多版本 Python
python·macos·mac
HashFlag5 天前
Git经典锁报错问题
linux·windows·git·mac
zhensherlock6 天前
Protocol Launcher 系列:Agenda 优雅组织你的想法与日程
javascript·macos·ios·typescript·node.js·mac·ipad
zhensherlock19 天前
Protocol Launcher 系列:Pika 取色器的协议控制(上篇)
前端·javascript·macos·typescript·github·mac·view design
钱多多_qdd19 天前
mac上安装claude
ai·mac
zhensherlock22 天前
Protocol Launcher 系列:App Store 精准引流与应用推广
javascript·macos·ios·typescript·iphone·mac·ipad
jianghao202525 天前
realesrgan-gui跨平台使用指南:Win/Mac/Linux全支持
linux·windows·mac·跨平台软件·realesrgan-gui
电饭叔1 个月前
利用ip地址帮助macbook系统连接带有wifi功能的epson电脑
电脑·mac·macbook·mac book添加打印机