码迷,mamicode.com
首页 > 其他好文 > 详细

【转】 Homebrew – OSX下简单的包管理系统

时间:2014-08-29 12:30:47      阅读:286      评论:0      收藏:0      [点我收藏+]

标签:des   style   http   os   使用   io   strong   ar   for   

很多linux用户很喜欢 (Debian/Ubuntu)系列的apt包管理系统和(Redhat/Fedora)系列的yum包管理系统。 包括Windows用户都有多种方便的软件管理工具,如:360软件管理,QQ软件管理,迅雷软件管理等多种。 Mac OS X系统下面之前有老牌的Macports,Fink包管理系统(以后小编会陆续介绍),包括apple的官方Mac App Store。 本篇文章小编我主要介绍一下Homebrew一款比较新的,方便的包管理系统。

Homebrew让你免去无数.configure  , make 等命令。

下面简单介绍一下Homebrew和使用方法:

1. 安装前准备:

安装Xcode,去apple官方网站下载xcode 一般有1G多大小,下载地址: http://developer.apple.com/technologies/xcode.html

2. 安装homebrew

在终端的命令行状态下面执行一下命令:
sudo ruby -e “$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)”
bubuko.com,布布扣

3. 通过homebrew安装程序
Homebrew安装成功后,会自动创建目录 /usr/local/Cellar 来存放Homebrew安装的程序。 这是你在命令行状态下面就可以使用 brew 命令了.
通过 brew install就可以安装软件了,如图:
bubuko.com,布布扣
通过 brew search 就可以搜索程序,例如 brew search vim ,就可以搜索名称包括vim的程序。

4. 更新包
通过 brew update 就可以把包信息更新到最新,不过包更新是通过git命令,所以要先通过 brew install git 命令安装git。如图
bubuko.com,布布扣

5. 其他命令
brew list 显示已安装的包
brew home [] 用浏览器打开相关包的页面
brew info [] 显示包信息
brew deps [] 显示包依赖
brew server 启动web服务器,可以通过浏览器访问http://localhost:4567/ 来同网页来管理包
brew -h brew帮助



Use man brew to view the manpage.

CommandDescription
brew --cache Print path to Homebrew’s download cache (usually ~/Library/Caches/Homebrew)
brew --cellar Print path to Homebrew’s Cellar (usually /usr/local/Cellar)
brew --config Print system configuration info
brew --env Print Homebrew’s environment
brew --prefix Print path to Homebrew’s prefix (usually /usr/local)
brew --prefix [formula] Print where formula is installed
brew audit Audit all formulae for common code and style issues
brew cleanup [formula] Remove older versions from the Cellar for all (or specific) formulae1
brew create [url] Generate formula for downloadable file at url, then open it in $BREW_EDITOR or $EDITOR2
brew create [tarball-url] --cache Generate formula (including MD5), then download the tarball
brew create --fink [formula] Open Fink’s search page in your browser, so you can see how they do formula
brew create --macports [formula] Open MacPorts’ search page in your browser, so you can see how they do formula
brew doctor Check your Homebrew installation for common issues
brew edit Open all of Homebrew for editing in TextMate
brew edit [formula] Open [formula] in $HOMEBREW_EDITOR or $EDITOR
brew fetch --force -v --HEAD [formula] Download source package for formula; for tarballs, also prints MD5 andSHA1 checksums
brew home Open Homebrew’s homepage in your browser
brew home [formula] Opens formula ’s homepage in your browser
brew info Print summary of installed packages
brew info [formula] Print info for formula (regardless of whether formula is installed)
brew info --github [formula] Open Github’s History page for formula in your browser
brew install [formula] Install formula
brew install --HEAD [formula] Install the HEAD version of formula (if its formula definesHEAD)
brew install --force --HEAD [formula] Install a newer HEAD version of formula (if its formula definesHEAD)
brew link [formula] Symlink all installed files for formula into the Homebrew prefix3
brew list [formula] List all installed files for formula (or all installed formulae with no arguments )
brew options [formula] Display install options specific to formula.
brew outdated List formulae that have an updated version available (brew install formula will install the newer version)
brew prune Remove dead symlinks from Homebrew’s prefix4
brew remove [formula] Uninstall formula
brew search List all available formula
brew search [formula] Search for formula in all available formulae
brew search /[formula]/ Search for /formula/ (as regex) in all available formulae
brew unlink [formula] Unsymlink formula from Homebrew’s prefix
brew update Update formulae and Homebrew itself
brew upgrade Install newer versions of outdated packages

You can update outdated packages with any of the following:

  • brew upgrade
  • brew install `brew outdated`
  • brew outdated | xargs brew install

1 To delete a specific version, just go to the folder in the Cellar andrm -rf it; alternatively, drag it to the trash in Finder.

2 Homebrew tries to guess the formula name and version. If it fails, you’ll have to make your own template. I suggest copyingwget ’s.

3 Symlinking is automatically performed when installing formulae. It’s useful forDIY installation, or swapping out versions of a package you have multiple installs of.

4 This is generally not needed. However, it can be useful if you are doingDIY installations.

【转】 Homebrew – OSX下简单的包管理系统

标签:des   style   http   os   使用   io   strong   ar   for   

原文地址:http://www.cnblogs.com/Androider123/p/3944409.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!