MAC工具之【brew】
下载命令:
1 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
卸载命令:
1 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 2 cd `brew –prefix` 3 rm -rf Cellar 4 brew prune 5 rm `git ls-files` 6 rm -rf Library .git .gitignore bin/brew 7 rm -rf README.md share/man/man1/brew 8 rm -rf Library/Homebrew Library/Aliases 9 rm -rf Library/Formula Library/Contributions 10 rm -rf ~/Library/Caches/Homebrew
检查:
//查看brew的帮助: brew –help //安装软件: brew install git //卸载软件: brew uninstall git //搜索软件: brew search git //显示已经安装软件列表: brew list //更新软件,把所有的Formula目录更新,并且会对本机已经安装并有更新的软件用*标明。:brew update //更新某具体软件: brew upgrade git //查看软件信息: brew [info | home] [FORMULA...] //删除程序,和upgrade一样,单个软件删除和所有程序老版删除。 brew cleanup git brew cleanup //查看那些已安装的程序需要更新: brew outdated //其它Homebrew指令: brew list //—列出已安装的软件 brew update //—更新Homebrew brew home * //—用浏览器打开 brew info * //—显示软件内容信息 brew deps * //—显示包依赖 brew server * //—启动web服务器,可以通过浏览器访问 //http://localhost:4567/ 来同网页来管理包 brew -h brew //—帮助
国内安装方式:
1 1、创建Homebrew插件目录 2 sudo mkdir /usr/local/Homebrew sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git /usr/local/Homebrew 3 4 2、创建软连接 5 sudo ln -s /usr/local/Homebrew/bin/brew /usr/local/bin/brew 如果文件已存在,则执行sudo rm -rf /usr/local/bin/brew 6 7 3、创建并同步homebrew-core、homebrew-cask 8 sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask sudo git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask 9 10 4、授权 11 sudo chown -R $(whoami) /usr/local/Homebrew sudo chown -R $(whoami) /usr/local/Homebrew/Library/Taps/homebrew sudo chown -R $(whoami) /usr/local/Cellar 12 13 5、验证 14 brew -v
版权声明:本文为wang1001原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。