OS X 套件管理器安装(Homebrew)

获取 Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

打开终端窗口, 粘贴以上脚本。

脚本会解释它的作用,然后在您的确认下执行安装。高级安装选项请看 这里(需要10.5)。

安装过程记录

1.输入命令后会出现如下提示,回车继续安装,按其他任意键退出

Last login: Thu Jul 28 16:39:52 on ttys000

localhost:~ luomeng$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

==> This script will install:

/usr/local/bin/brew

/usr/local/Library/...

/usr/local/share/doc/homebrew

/usr/local/share/man/man1/brew.1

/usr/local/share/zsh/site-functions/_brew

/usr/local/etc/bash_completion.d/brew

==> The following directories will be made group writable:

/usr/local/.

/usr/local/bin

/usr/local/lib

==> The following directories will have their owner set to luomeng:

/usr/local/.

/usr/local/bin

/usr/local/lib

==> The following directories will have their group set to admin:

/usr/local/.

/usr/local/bin

/usr/local/lib

Press RETURN to continue or any other key to abort

2.回车后让你输入你的电脑的密码,密码输入的时候界面不会有任何显示,输完回车即可,接下来就会在自动创建一些文件夹并下载相应的文件。安装完成的时候,你可以通过访问:https://git.io/brew-docs  https://git.io/brew-analytics ;一些相关的文档

/usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/lib

Password:

==> /usr/bin/sudo /usr/sbin/chown luomeng /usr/local/. /usr/local/bin /usr/local/lib

==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin /usr/local/lib

==> /usr/bin/sudo /bin/mkdir -p /Users/luomeng/Library/Caches/Homebrew

==> /usr/bin/sudo /bin/chmod g+rwx /Users/luomeng/Library/Caches/Homebrew

==> /usr/bin/sudo /usr/sbin/chown luomeng /Users/luomeng/Library/Caches/Homebrew

==> Downloading and installing Homebrew...

remote: Counting objects: 530, done.

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

remote: Total 530 (delta 32), reused 306 (delta 29), pack-reused 0

Receiving objects: 100% (530/530), 785.73 KiB | 142.00 KiB/s, done.

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

From https://github.com/Homebrew/brew

* [new branch]      master    -> origin/master

HEAD is now at 97b6a30 test: add default Linux x86_64 bottle.

==> Tapping homebrew/core

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

remote: Counting objects: 3717, done.

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

remote: Total 3717 (delta 15), reused 1942 (delta 4), pack-reused 0

Receiving objects: 100% (3717/3717), 2.88 MiB | 278.00 KiB/s, done.

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

Checking connectivity... done.

Tapped 3595 formulae (3,743 files, 9.0M)

==> Installation successful!

==> Next steps

Run `brew help` to get started

Further documentation: https://git.io/brew-docs

==> Homebrew has enabled anonymous aggregate user behaviour analytics

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

https://git.io/brew-analytics

localhost:~ luomeng$

3.输入brew help可以看所有的功能了,在此不做一一解释了

localhost:~ luomeng$ brew help

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

Brewing:

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

brew edit [FORMULA...]

https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md

Further help:

man brew

brew help [COMMAND]

brew home

localhost:~ luomeng$

What Does Homebrew Do?

又提示缺少套件啦?别担心,Homebrew 随时守候。

$ brew install wget

Homebrew 会将套件安装到独立目录,并将文件软链接至 /usr/local 。

$ cd /usr/local

$ find Cellar

Cellar/wget/1.16.1

Cellar/wget/1.16.1/bin/wget

Cellar/wget/1.16.1/share/man/man1/wget.1

$ ls -l bin

bin/wget -> ../Cellar/wget/1.16.1/bin/wget

Homebrew 的所有文件均会被安装到预定义目录下,所以您无需担心 Homebrew 的安装位置。

轻松创建您的 Homebrew 程式。

$ brew create https://foo.com/bar-1.0.tgz

Created /usr/local/Library/Formula/bar.rb

以 git、 ruby 为其筋骨,所以借助您的相关知识,自由修改,并且可以简单撤回您的调改或者合并上游更新。

$ brew edit wget # 使用 $EDITOR 编辑!

Homebrew 的程式都是简单的 Ruby 脚本:

class Wget < Formula

homepage "https://www.gnu.org/software/wget/"

url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz"

sha256 "52126be8cf1bddd7536886e74c053ad7d0ed2aa89b4b630f76785bac21695fcd"

def install

system "./configure", "--prefix=#{prefix}"

system "make", "install"

end

Homebrew 使 OS X 更完美。使用 gem 来安装 gems、用 brew 来搞定那些依赖包。

原文链接:http://brew.sh/index_zh-cn.html

获取 Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

打开终端窗口, 粘贴以上脚本。

脚本会解释它的作用,然后在您的确认下执行安装。高级安装选项请看 这里(需要10.5)。

安装过程记录

Last login: Thu Jul 28 16:39:52 on ttys000

localhost:~ luomeng$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

==> This script will install:

/usr/local/bin/brew

/usr/local/Library/...

/usr/local/share/doc/homebrew

/usr/local/share/man/man1/brew.1

/usr/local/share/zsh/site-functions/_brew

/usr/local/etc/bash_completion.d/brew

==> The following directories will be made group writable:

/usr/local/.

/usr/local/bin

/usr/local/lib

==> The following directories will have their owner set to luomeng:

/usr/local/.

/usr/local/bin

/usr/local/lib

==> The following directories will have their group set to admin:

/usr/local/.

/usr/local/bin

/usr/local/lib

Press RETURN to continue or any other key to abort

file:///Users/luomeng/Library/Containers/com.tencent.qq/Data/Library/Application%20Support/QQ/Users/812610313/QQ/Temp.db/00D00EDB-EF24-4BEA-84C4-59F37A5B0CCA.png

What Does Homebrew Do?

又提示缺少套件啦?别担心,Homebrew 随时守候。

$ brew install wget

Homebrew 会将套件安装到独立目录,并将文件软链接至 /usr/local 。

$ cd /usr/local

$ find Cellar

Cellar/wget/1.16.1

Cellar/wget/1.16.1/bin/wget

Cellar/wget/1.16.1/share/man/man1/wget.1

$ ls -l bin

bin/wget -> ../Cellar/wget/1.16.1/bin/wget

Homebrew 的所有文件均会被安装到预定义目录下,所以您无需担心 Homebrew 的安装位置。

轻松创建您的 Homebrew 程式。

$ brew create https://foo.com/bar-1.0.tgz

Created /usr/local/Library/Formula/bar.rb

以 git、 ruby 为其筋骨,所以借助您的相关知识,自由修改,并且可以简单撤回您的调改或者合并上游更新。

$ brew edit wget # 使用 $EDITOR 编辑!

Homebrew 的程式都是简单的 Ruby 脚本:

class Wget < Formula

homepage "https://www.gnu.org/software/wget/"

url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz"

sha256 "52126be8cf1bddd7536886e74c053ad7d0ed2aa89b4b630f76785bac21695fcd"

def install

system "./configure", "--prefix=#{prefix}"

system "make", "install"

end

Homebrew 使 OS X 更完美。使用 gem 来安装 gems、用 brew 来搞定那些依赖包。

原文链接:http://brew.sh/index_zh-cn.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 158,560评论 4 361
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,104评论 1 291
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,297评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,869评论 0 204
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,275评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,563评论 1 216
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,833评论 2 312
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,543评论 0 197
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,245评论 1 241
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,512评论 2 244
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,011评论 1 258
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,359评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,006评论 3 235
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,062评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,825评论 0 194
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,590评论 2 273
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,501评论 2 268

推荐阅读更多精彩内容