Homebrew
Homebrew安装
- 提前安装Xcode(App Store)和ruby(系统自带);
- 在命令行输入下列代码:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install) - 尽量不要使用6.3,网上很多gcc编译器出错无法编译等问题,大家都猜测是xcode最近的更新导致的
Homebrew使用
下面用git举例:
安装软件
brew install git
卸载软件brew uninstall git
搜索软件brew search git
更新软件brew upgrade git
重新安装brew reinstall git
删除软件brew cleanup git
查看哪些软件需要更新brew outdated
更新所有软件brew upgrade
显示已经安装的软件列表brew list
Homebrew文件存储位置
/usr/local/bin 用于存放所安装程序的启动链接(相当于快捷方式)
/usr/local/Cellar 所以brew安装的程序,都将以[程序名/版本号]存放于本目录下
/usr/local/etc brew安装程序的配置文件默认存放路径
/usr/local/Library Homebrew 系统自身文件夹
利用Homebrew-cask安装应用程序
-
Homebrew-cask可以帮助你简洁的一键安装各种软件
-
Homebrew-cask安装:
$ brew tap phinze/homebrew-cask && brew install brew-cask
==> Tapping phinze/cask
Cloning into '/usr/local/Library/Taps/phinze/homebrew-cask'...
.... -
homebrew-cask使用:
brew cask install xxx安装xxx软件
brew cask search查询所有可以被安装的软件
brew cask search drop查找所有和 drop 有关的的软件
brew cask info xxx查看xxx的应用信息
brew cash uninstall xxx卸载xxx
brew update && brew upgrade更新所有应用程序
Homebrew报错
-
可以重新安装(后面是我重装时的提示信息):brew reintall xxx
$ pkg_config -bash: pkg_config: command not found $ brew reinstall pkg-config ==> Reinstalling pkg-config ==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.28.yosemite.bo Already downloaded: /Library/Caches/Homebrew/pkg-config-0.28.yosemite.bottle.2.tar.gz ==> Pouring pkg-config-0.28.yosemite.bottle.2.tar.gz 🍺 /usr/local/Cellar/pkg-config/0.28: 10 files, 612K $ pkg-config Must specify package names on the command line
浙公网安备 33010602011771号