Mac brew 安装软件

Mac brew 安装软件

homebrew 速度慢

将brew 切换到国内镜像源

# 速度一般
# 步骤一
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
# 速度比较快
# 替换 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速度变快很多了,不会卡在那半天没动静,替换镜像完成。

复原方法

# 步骤一
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 几个常用的命令
#查看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
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
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值