獲取 Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
打開終端窗口, 粘貼以上腳本当纱。
腳本會解釋它的作用笋籽,然后在您的確認下執(zhí)行安裝峦睡。高級安裝選項請看 這里(需要10.5)峭判。
安裝過程記錄
1.輸入命令后會出現如下提示魁巩,回車繼續(xù)安裝徒役,按其他任意鍵退出
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.回車后讓你輸入你的電腦的密碼寞蚌,密碼輸入的時候界面不會有任何顯示,輸完回車即可麸折,接下來就會在自動創(chuàng)建一些文件夾并下載相應的文件锡凝。安裝完成的時候,你可以通過訪問: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 的安裝位置。
輕松創(chuàng)建您的 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)"
打開終端窗口, 粘貼以上腳本。
腳本會解釋它的作用酥郭,然后在您的確認下執(zhí)行安裝华坦。高級安裝選項請看 這里(需要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 的安裝位置。
輕松創(chuàng)建您的 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