mac之brew安裝卸載使用

(一)安裝git

1.瀏覽器打開brew.sh,進入homebrew主頁。找到install homebrew 的命令:github

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

2.打開iterm,鍵入sudo chown -R $USER /usr/local。解釋下這個操做:/usr/local目錄默認狀態下是禁止非root用戶的寫文件權限的,因此把這個目錄chown -r 給當前安裝用戶。若是沒有這個操做,安裝brew的時候會大量的報相似「error: unable to unlink old xxxxx」的錯誤,其緣由就是Permission denied。瀏覽器

3.在iterm裏執行/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"ruby

4.安裝完成,能夠經過man brew 查看其相關信息bash

(二)卸載curl

cd `brew --prefix`url

rm  -rf Cellar
brew prune
rm  `git  ls -files`
rm  -r Library /Homebrew  Library /Aliases  Library /Formula  Library /Contributions
rm  -rf .git
rm  -rf ~ /Library/Caches/Homebrew
相關文章
相關標籤/搜索