mac之homebrew安裝

經過homebrew能夠管理衆多開源軟件的安裝和卸載。使用homebrew能夠很是容易的安裝 os x中沒有包含的unix工具包和語言包,好比wget;node;lua;rabbitmq;nginx等
 
安裝
1.在終端運行命令
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
第一次安裝提示信息:
localhost:~ bobo$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/bin
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/opt
/usr/local/sbin
/usr/local/share
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var
 
Press RETURN to continue or any other key to abort
 
當執行到 fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443: Operation timed out
 
2.好吧,既然沒有安裝成功(可能有臨時文件)那就卸載乾淨從新安裝唄
執行卸載命令:
localhost:~ bobo$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
奶奶的,說什麼沒有找到改軟件
Failed to locate Homebrew!
 
3.你既然說沒有找到該軟件(就是沒有安裝唄),那就再次執行安裝命令唄
localhost:~ bobo$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
火大了!!! 又提示我已經安裝過啦 哼哼哼~
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin Cellar etc Frameworks Homebrew include lib opt sbin share var
 
4.沒辦法啊,去卸載乾淨再來吧。喪~
網上各類命令卸載都很差使,既然有安裝的臨時文件,那就各類刪除臨時文件。
依第一次安裝新建的文件夾住要刪除Cellar ; Frameworks ; Homebrew此三個文件
---> local ls -al
rm -rf Cellar Frameworks Homebrew
注:文件夾可能刪除不了報「權限拒絕訪問」 , 查看筆記命令(經常使用)
5.再次安裝
localhost:~ bobo$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-e:82: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
==> This script will install:
/usr/local/bin/brew
/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
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks
 
Press RETURN to continue or any other key to abort
 
此次安裝只新建了3個文件夾,就是以前刪除的那三個。
繼續往下執行,最後出現下面的提示表示安裝成功
==> 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:
 
執行brew help , 正常顯示命令幫助,nice。
相關文章
相關標籤/搜索