关注各种黑科技
B站UP主,编程教学,游戏玩家,挂B,金牛座

MAC OS X homebrew使用技巧

我来简单介绍一下homebrew使用的常用方法。 我在安装完成osx以后,第一个安装的软件就是它了。 首先搜索某个软件,比如python ~~~ $ brew search python app-engine-python micropython python3 boost-python python wxpython gst-python python-markdown zpython homebrew/apache/mod_python homebrew/versions/gst-python010 homebrew/python/python-dbus Caskroom/cask/kk7ds-python-runtime homebrew/python/vpython Caskroom/cask/mysql-connector-python homebrew/versions/boost-python159 ~~~ 其中不带斜线的是homebrew官方维护的,可以直接安装 这里发现2个python和python3,查看具体信息 ~~~ $ brew info python python: stable 2.7.13 (bottled), HEAD Interpreted, interactive, object-oriented programming language https://www.python.org Not installed From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb ==> Dependencies Build: sphinx-doc ✘, pkg-config ✘ Required: openssl ✘ Recommended: readline ✘, sqlite ✘, gdbm ✘ Optional: sphinx-doc ✘, homebrew/dupes/tcl-tk ✘, berkeley-db4 ✘ ==> Options --universal Build a universal binary ... ==> Caveats Pip and setuptools have been installed. To update them pip install --upgrade pip setuptools ... ~~~ 列出了python的版本号是2.7.13,那么python3是 python3: stable 3.5.2 (bottled), devel 3.6.0rc2, HEAD 有2个分支选择。 Dependencies 给出了安装依赖,brew会自动为我们安装。 重点是Caveats 附加说明部分,这里面的部分内容,可能在你安装完成后,会反复查看。比如你安装了一个nginx,这里会提示启动nginx的命令,开机启动如何配置,配置文件在哪里等等你所应该了解的细节。 安装一个包 ~~~ brew install python ~~~ 升级一个包 ~~~ brew upgrade python ~~~ 列出所有已安装的包 ~~~ brew list ~~~ 更新源 ~~~ brew update ~~~ 查看版本已经过期的包 ~~~ brew outdated ~~~ 更新全部包 ~~~ brew upgrade ~~~ 删除某个包 ~~~ brew uninstall python ~~~ 查看更多帮助内容 ~~~ brew help ~~~ 安装的包存放的目录 ~~~ ls /usr/local/Cellar/ ~~~ 可以在网上查到其他formula http://brewformulas.org/ https://formulae.brew.sh/formula/tomcat 参考 http://brew.sh/index_zh-cn.html https://git.io/brew-docs http://ricostacruz.com/cheatsheets/homebrew.html
转载请注明出处
分享到: 更多 (0)

评论 1