菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
405
0

MAC电脑安装brew

原创
05/13 14:22
阅读数 32810

安装

首先打开brew.sh网站,把首页一条命令复制到终端里,执行,输入电脑登录密码,开始下载安装

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

换源

安装完后,因为国内网络的原因,需要更换一些快一点的源
我一直比较倾向于阿里的东西,虽然我也不知道哪个更好~~

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

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

刷新源
brew update

重置源

OK 了,如果需要出国使用,则需要把源重置回官方,代码如下

重置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

bottles部分需要修改配置文件
vim ~/.zshrc
找到export HOMEBREW_。。。两行字母,在行首字符加#,把两行字母注释掉就OK 了

Homebrew能干什么?

使用 Homebrew 安装 Apple(或您的 Linux 系统)没有预装但 你需要的东西。
个人觉得和centos系统上的yum&dnf很像,命令为 brew install XXX,快去试试吧。

发表评论

0/200
405 点赞
0 评论
收藏