Mac下更换Homebrew镜像源
1.使用中科大源
(1)替换默认源
第一步:替换brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
第二步:替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
cd
brew update
(2)替换Homebrew Bottles源
Homebrew是OS X系统的一款开源的包管理器。出于节省时间的考虑,Homebrew默认从Homebrew Bottles源中下载二进制代码包安装。Homebrew Bottles是Homebrew提供的二进制代码包,目前镜像站收录了以下仓库:
homebrew/homebrew-core
homebrew/homebrew-dupes
homebrew/homebrew-games
homebrew/homebrew-gui
homebrew/homebrew-python
homebrew/homebrew-php
homebrew/homebrew-science
homebrew/homebrew-versions
homebrew/homebrew-x11
对于bash用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
对于zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
2.使用清华源
(1)替换默认源
第一步:替换现有上游
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
cd
brew update
第二步:使用homebrew-science或者homebrew-python
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-science"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-science.git
或
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-python"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-python.git
cd
brew update
(2)替换Homebrew Bottles源
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
3.在中科大源或清华源失效或宕机时可以切换回官方源
第一步:重置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
cd
brew update
第三步:注释掉bash配置文件里的有关Homebrew Bottles即可恢复官方源。 重启bash或让bash重读配置文件。
Mac下更换Homebrew镜像源相关推荐
- windows更改pip源_windows环境下 更换pip镜像源
windows 环境下 更换pip镜像(从国外源更新为国内源) 第一步: 在C:\Users\Administrator 目录下 创建pip文件 第二步: 在第一步创建的文件夹下创建pip.ini文 ...
- Mac下brew更换国内镜像源
使用清华镜像源 官方使用说明 在终端一次运行如下每一行代码 git -C "$(brew --repo)" remote set-url origin https://mirror ...
- Homebrew更换国内镜像源(中科大、阿里、清华)
Homebrew官方的源一般下载包之类的会很慢,所以通常我们都是用国内的镜像源来代替,这样会提高我们的效率.Homebrew主要有四个部分组成: brew.homebrew-core .homebre ...
- 更新mac系统中homebrew的源,更改为清华大学的源
在mac系统中,使用homebrew可以很方便的管理包.按照官网的说明执行以下命令时总是报错: /usr/bin/ruby -e "$(curl -fsSL https://raw.git ...
- Mac下安装homebrew(解决error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL)
Mac下安装homebrew 直接说方法 1.将brew的install文件下载本地 2.修改install文件的镜像源 3.开始安装 4.替换homebrew源 5.更新(确认为最新版本) 6.设置 ...
- windows更改pip源_Windows下更改pip镜像源
其实学习是一个逐步探索的过程.今天因为把带有中文的Python安装路径给改了,结果带来很大的麻烦,导致在命令行输入vietualenv和其他一些第三方模块都出现Fatal error in launc ...
- pip更换国内镜像源
在采用默认的 pip 安装一些第三方库的时候,由于被墙,经常会出现连接超时的傻逼情况. pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSCo ...
- Ubuntu更换apt镜像源
原文:Ubuntu更换apt镜像源 在ubuntu中,默认使用 ubuntu 的官方源http://archive.ubuntu.com/,但是这个官方源在国内下载的速度太慢,甚至只有几十k.于是考虑 ...
- Ubuntu 更换清华大学镜像源
Ubuntu 更换镜像源 通常我们使用ubunntu的时候总是出现网络过慢导致的更新下载失败等问题. Ubuntu默认的服务器是在国外,自然连接就很慢. 这里我们更换成国内的镜像源,这里使用清华镜像源 ...
最新文章
- 【Markdown编辑器】LaTeX公式教程
- php 数组合并_PHP数组常用函数分类整理
- Linux命令 - 帮助命令 man
- Master PDF editor在ubuntu下面的配置
- oracle数据本机自动备份
- 给数据表中的字段添加约束
- access 如何使用dolby_Access/VBA/Excel-Access表及字段创建-03
- MySQL优化(2)--------常用优化
- Extjs弹出框的异步执行
- websocket来回收发消息
- css 固定宽度超出部分换行,css怎么超出宽度换行
- Xcode打包IPA包
- 微信客户管理SCRM系统SDK
- oracle错误1327,问题简述:在oracle linux下安装oracle10g,多个文件报“Permission denied”错误...
- 强化学习(一):简介——什么是强化学习?
- 爱加密,梆梆,360加固初比较
- 光学测量精度极限—光谱共焦位移传感器的六大行业应用
- 微机原理与接口技术:并行接口
- zemax中如何快速查看波像差
- 微信小程序实现首页图片多种排版布局!