MacOS下命令列安裝神器brew
1、安裝brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2、解除安裝brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
3、它的用法:
brew update 更新brew
brew install 應用名 安裝軟體
brew cask install 應用名 下載安裝軟體
4、解決高版本macos上brew偶發性無法使用問題
網上大部分部落格方法為:sudo chown -R `whoami` /usr/local
但是會報錯: chown: /usr/local: Operation not permitted
解決策:
① 本人親測
cd /usr/local
sudo chown -R <your-username>:<your-group-name> *
② 未實際測試
sudo chgrp -R admin /usr/local/Homebrew/
sudo chmod -R g+w /usr/local/Homebrew/
sudo chgrp -R admin /usr/local/var/homebrew/
sudo chmod -R g+w /usr/local/var/homebrew/
③ 解除安裝重灌brew