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
相关推荐
亚林瓜子4 小时前
git中移除.DS_Store文件夹和相关文件
git·mac·ignore·.ds_store
喵霓5 小时前
mac—安装wget过程
mac
程序员霸哥哥3 天前
XYplorer(多标签文件管理器) v27.20.0700 / 28.00.1200 多语便携版
windows·macos·软件工程·mac·应用软件·xyplorer
雪花凌落的盛夏4 天前
电脑安装黑苹果教程,MacOS教程(未验证版)
macos·电脑·mac
刀鱼i足球4 天前
mac笔记本只安装windows系统wifi消失
windows·mac
YF02115 天前
Frida如何稳定连接PC端跟Android手机端
android·mac·xposed
小蹦跶儿7 天前
Mac 端企业微信调试工具开启指南:解决页面兼容性问题必备
mac
侯小啾14 天前
理解计算机网络中的MAC地址
网络·计算机网络·macos·mac
心灵宝贝23 天前
Mac 下载 VMware 11.1.0-1.dmg 后如何安装?超简单教程
mac
嚴寒25 天前
我在 Mac 用一行脚本征服了 5TB NTFS:拒绝付费,彻底搞定免费方案
macos·mac