网站优化图片,中国最新军事消息,dw个人简历网页制作,山东德州最新消息今天本文介绍mac上homebrew工具的安装、配置过程。homebrew功能类似于centos的yum#xff0c;用于软件包的管理#xff0c;使用上有命令的差异。 本次配置过程使用mac#xff0c;看官方文档#xff0c;在linux上也可以用#xff0c;但我没试过#xff0c;有兴趣的同学可以试试…本文介绍mac上homebrew工具的安装、配置过程。homebrew功能类似于centos的yum用于软件包的管理使用上有命令的差异。 本次配置过程使用mac看官方文档在linux上也可以用但我没试过有兴趣的同学可以试试。
1、安装
打开终端复制如下命令
/bin/bash -c $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)这个要花几分钟安装过程中要下载别着急。完成后效果如下 看一下版本
brew -v2、更换源
homebrew默认的源在国外国内使用时老是超时我们换成国内源便于使用。先看一下当前的源
cd $(brew --repo) git remote -v看见了吧咱们现在改成清华大学的。
#··1、换源
git -C $(brew --repo) remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C $(brew --repo homebrew/core) remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C $(brew --repo homebrew/cask) remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git#··2、修改zshrc文件
echo export HOMEBREW_BOTTLE_DOMAINhttps://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles ~/.zshrc
source ~/.zshrc#··3、更新
brew update等待update完成就可以用homebrew安转软件了。
3、homebrew常用命令
brew search 名称 查找brew install 名称版本 安装对应版本的软件brew services start 名称 启动服务brew services info 名称查看服务信息包括运行、停止等状态brew uninstall 名称卸载brew --help homebrew的帮助比较简单
4、装个redis试试
brew install redis
brew services list 由上图看出redis目前处于运行状态进入redis再看看直接连接
redis-cli# 连接成功后再看看server信息
# 注意这个命令不是bash命令是redis链接成功后redis客户端的命令。
info server redis安装成功了你可以试试mysql或其他软件。