当前位置: 首页 > news >正文

mac修改国内源快速安装brew

我是参考了清华源官网,有任何困惑直接访问该网址即可。这里给出精简版。

1. 更改镜像到~/.zshrc

终端添加方式

echo export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api" >> ~/.zshrcecho export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.zshrcecho export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" >> ~/.zshrcecho export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" >> ~/.zshrcecho export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.zshrc

或者直接在~/.zshrc添加以下内容

export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"

接下来输入

source ~/.zshrc

2. 下载brew

依次输入以下命令

git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn git/homebrew/install.git brew-install
/bin/bash brew-install/install.sh
rm -rf brew-install
brew update

安装好了,查看源是否正确

brew config

3. 改问题

输入brew doctor

如果出现

Warning: Homebrew’s “sbin” was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting your PATH for example like so:
echo ‘export PATH=“/usr/local/sbin:$PATH”’ >> ~/.zshrc

那就按照它说的输入

echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

重新输入brew doctor

如果没问题,就会显示,大功告成

Your system is ready to brew.

http://www.lryc.cn/news/33992.html

相关文章:

  • Me-and-My-Girlfriend-1靶场通关
  • 2.6 棋盘覆盖
  • JMU软件20 大数据技术复习(只写了对比18提纲的变动部分)
  • MySQL底层存储B-Tree和B+Tree原理分析
  • 基于Vue+Vue-cli+webpack搭建渐进式高可维护性前端实战项目
  • 第十三章:Java反射机制
  • iLok USB不识别怎么办?
  • 【LeetCode与《代码随想录》】二叉树篇:做题笔记与总结-JavaScript版
  • 机器人运动|浅谈Time Elastic Band算法
  • 【Linux】网络基础(1)
  • 限流算法详解
  • Spark/Hive
  • HashMap底层的实现原理(JDK8)
  • 操作系统-整理
  • 系统换行符的思考
  • Wwise集成到unreal
  • 前端秘籍之=>八股文经卷=>(原生Js篇)【持续更新中...】
  • 【Python安装配置教程】
  • Spring-Retry失败重试
  • 【目标检测 DETR】通俗理解 End-to-End Object Detection with Transformers,值得一品。
  • 项目ER图和资料
  • 剑指 Offer 20. 表示数值的字符串(java+python)
  • 程序员的逆向思维
  • 吐血整理学习方法,2年多功能测试成功进阶自动化测试,月薪23k+......
  • mysql慢查询:pt-query-digest 分析
  • git的使用整合
  • XCPC第九站———背包问题!
  • 【软考 系统架构设计师】论文范文④ 论基于构件的软件开发
  • spring-integration-redis中分布式锁RedisLockRegistry的使用
  • 城市通电(prim算法)