Mac 安装 brew

简介:

一,安装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*/是使用的正则表达式,用/分割。













本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/7658934.html,如需转载请自行联系原作者


相关文章
|
1月前
|
开发工具 git iOS开发
Mac 安装软件包管理工具Homebrew
Mac 安装软件包管理工具Homebrew
|
3月前
|
Unix 网络安全 iOS开发
Mac 电脑如何安装Wireshark?
Mac 电脑如何安装Wireshark?
Mac 电脑如何安装Wireshark?
|
4月前
|
编解码 Linux Android开发
安卓投屏神器 Scrcpy 安装与使用(支持 Mac、Windows、Linux)
安卓投屏神器 Scrcpy 安装与使用(支持 Mac、Windows、Linux)
225 0
|
5天前
|
Java Android开发 芯片
Mac M芯片安装DBeaver Ultimate
Mac M芯片安装DBeaver Ultimate
10 0
Mac M芯片安装DBeaver Ultimate
|
4月前
|
Kubernetes API Docker
Mac docker-desktop 安装单机版k8s
Mac docker-desktop 安装单机版k8s
100 0
|
1月前
QT 5.14.2版本 MAC环境安装部署流程
QT 5.14.2版本 MAC环境安装部署流程
|
1月前
|
iOS开发 MacOS Python
Mac安装pip报错的解决办法
Mac安装pip报错的解决办法
|
1月前
|
存储 Ubuntu Linux
如何在 Mac M1 (Apple Silicon) 上安装 ABAP 1909
如何在 Mac M1 (Apple Silicon) 上安装 ABAP 1909
11 0
|
2月前
|
NoSQL 关系型数据库 MySQL
Windows、Linux、Mac安装数据库(mysql、MongoDB、Redis)#0
不同系统下进行MySQL安装、MongoDB安装、Redis安装【2月更文挑战第5天】
440 5
Windows、Linux、Mac安装数据库(mysql、MongoDB、Redis)#0
|
2月前
|
关系型数据库 MySQL 数据安全/隐私保护
【MySQL】 Docker 安装 MySQL8.0(mac)
【MySQL】 Docker 安装 MySQL8.0(mac)