mac下安装和使用brew

原创 2016年11月22日 11:52:55

一,安装brew


1,安装brew

curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip 1


2,安装完成后执行

brew

提示:Please run brew update!


3,按照提示更新,执行

brew update

报错:Error: /usr/local must be writable!


4,赋给/usr/local目录权限,执行sudo chown -R $(whoami) /usr/local,即

sudo chown -R fxp /usr/local

其中fxp为系统当前用户名。


5,再次执行

brew update

提示:

remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0

HEAD is now at c3f959d Merge pull request #1542 from woodruffw/deprecate-utils-json

To restore the stashed changes to /usr/local run:

  'cd /usr/local && git stash pop'

==> Homebrew has enabled anonymous aggregate user behaviour analytics

Read the analytics documentation (and how to opt-out) here:

  https://git.io/brew-analytics

==> Tapping homebrew/core

Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...

remote: Counting objects: 3757, done.

remote: Compressing objects: 100% (3647/3647), done.

remote: Total 3757 (delta 13), reused 305 (delta 1), pack-reused 0

Receiving objects: 100% (3757/3757), 3.00 MiB | 30.00 KiB/s, done.

Resolving deltas: 100% (13/13), done.

Checking connectivity... done.

Tapped 3636 formulae (3,784 files, 9.3M)

Already up-to-date.

Error: Could not link:

/usr/local/share/doc/homebrew


Please delete these paths and run `brew update`.

==> Migrating HOMEBREW_REPOSITORY (please wait)...

Error: Could not link:

/usr/local/share/doc/homebrew


Please delete these paths and run `brew update`.

==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!

Homebrew no longer needs to have ownership of /usr/local. If you wish you can

return /usr/local to its default ownership with:

  sudo chown root:wheel /usr/local


6,按照提示删除/usr/local/share/doc/homebrew,执行

rm -r -f /usr/local/share/doc/homebrew


7,再次执行

brew update


安装更新成功!


二,使用brew


命令行下执行brew,用法提示如下:

Example usage:

  brew search [TEXT|/REGEX/]

  brew (info|home|options) [FORMULA...]

  brew install FORMULA...

  brew update

  brew upgrade [FORMULA...]

  brew uninstall FORMULA...

  brew list [FORMULA...]


Troubleshooting:

  brew config

  brew doctor

  brew install -vd FORMULA


Developers:

  brew create [URL [--no-fetch]]

  brew edit [FORMULA...]

  https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md


Further help:

  man brew

  brew help [COMMAND]

  brew home


常用命令有安装和卸载等,以安装和卸载autojump为例:

安装:sudo brew install autojump 

卸载:sudo brew uninstall wget

查看安装软件的话,命令如下:
sudo brew search /apache*/

注意/apache*/是使用的正则表达式,用/分割。



版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

Mac 安装homebrew

Homebrew官网 http://brew.sh/index_zh-cn.html Homebrew是神马 linux系统有个让人蛋疼的通病,软件包依赖,好在当前主流的两大发行版本都自带...

Mac OS X系统 HomeBrew的安装和简单使用

mac系统安装homebrew
  • G_eorge
  • G_eorge
  • 2016年05月11日 21:55
  • 8746

macbook之brew安装mysql

macbook的mysql意外无法正常启动 sudo mysql.server start Password: Starting MySQL .. ERROR! The server quit ...

mac 使用 brew

brew

mac安装brew 软件包管理工具Homebrew

mac 安装 brew Homebrew brew 全称Homebrew 是Mac OSX上的软件包管理工具 Homebrew 安装和卸载工具 只用一行命令就能完成 官方地址: http:...
  • aaawqqq
  • aaawqqq
  • 2015年03月05日 23:21
  • 58684

Mac上使用命令行安装brew,并通过brew安装Ant等工具

Mac终端一行命令安装brew,通过brew,又可以一行命令安装想要的软件

brew 安装nginx-full

http://brew.sh/homebrew-nginx/ Install tap You can install the tap by running the foll...

HomeBrew的安装和简单使用

转自:http://blog.csdn.net/maojudong/article/details/7918291 1.  前言 作为linux系统的忠实粉丝,我们都很...

Mac安装Brew

安装命令如下: curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --str...

打造前端MAC工作站(三)使用brew利用命令行安装软件

打造前端MAC工作站(三)使用brew利用命令行安装软件前情回顾打造前端MAC工作站(一)简单系统配置 打造前端MAC工作站(二)安装软件的两种方法前言最好的系统是linux,只是我们前端工程师的一...
  • FungLeo
  • FungLeo
  • 2017年02月26日 23:10
  • 3000
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:mac下安装和使用brew
举报原因:
原因补充:

(最多只允许输入30个字)