ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Mac brew 配置&操作

2021-03-07 18:04:07  阅读:500  来源: 互联网

标签:core git bottles 配置 Mac https brew homebrew



1.替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

2.替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

3.终端输入命令:
echo $SHELL 看输出结果是/bin/zsh还是/bin/bash
/bin/zsh替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc

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

4、恢复homebrew国内镜像源配置
①、重置brew.git
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
②、重置homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
③、重置homebrew-bottles
将~/.bash_profile或~/.zshrc
HOMEBREW_BOTTLE_DOMAIN 进行注释


查找软件 brew search software
安装软件 brew install php
安装指定版本 brew install php@7.4

卸载 brew uninstall php

启动php@7.4 brew services start php@7.4

vim ~/.zshrc
环境变量写入 export PATH="$HOME/.composer/vendor/bin:$PATH" // $HOME代表 ~

 

标签:core,git,bottles,配置,Mac,https,brew,homebrew
来源: https://www.cnblogs.com/blue-t/p/14495652.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有