Homebrew – mac and linux 软件管理工具
0.什么是Homebrew
Homebrew 是一款macOS(或者linux)的软件管理工具,它可以很方便的帮你下载,更新,卸载,管理你的命令行工具和一些软件。简单一条命令实现各种工具的安装,无需再关心一些繁杂的软件包依赖。
官 地址:
https://brew.sh/index_zh-cn
1.Homebrew 安装
安装
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.安装软件
下面以一个安装nginx的例子来介绍一下brewhome的软件安装
## 查看是否有nginx这个软件brew search nginx ## 安装nginxbrew install nginx## brew 启动nginxbrew services start nginx## 访问http://localhost:8080,就能看到nginx的欢迎页面了。## 查看brew启动的服务brew services list## brew关闭nginxbrew services stop nginx## 卸载软件brew uninstall nginx## 更新软件brew upgrade nginx## 查看软件信息brew info nginx## 查看已经安装的软件brew list##查看可以更新的软件列表brew outdated## 显示软件包的依赖情况brew deps nginx
3.设置国内homebrew镜像
因为 络限制,国外的github软件镜像速度总是不尽人意。可以修改为国内的进行加速软件的安装
修改核心软件库镜像
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
修改cask 软件仓库(提供 macOS 应用和大型二进制文件)
cd "$(brew --repo)"/Library/Taps/caskroom/homebrew-caskgit remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
替换 Bottles 源(Homebrew 预编译二进制软件包)
bash用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profilesource ~/.bash_profile
zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrcsource ~/.zshrc
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!