[Switch] homebrew-OSX simple package management system

Source: Internet
Author: User
Tags install homebrew

Many Linux users like the apt package management system (Debian/UBUNTU) and the yum package management system (RedHat/Fedora. Windows users have a variety of convenient software management tools, such as 360 software management, QQ Software management, and thunder software management. Macports And Fink package management systems (which will be introduced later) are available in Mac OS X systems, including Apple's official Mac app store. This article introduces homebrew, a relatively new and convenient package management system.

Homebrew frees you from numerous. Configure, make and other commands.

The following describes how to use homebrew:

1. Preparations before installation:

Install xcode, go to Apple official website download xcode generally has more than 1 GB size,: http://developer.apple.com/technologies/xcode.html

2. Install homebrew

Run the following command in the command line status of the terminal:
Sudo ruby-E "$ (curl-fssl https://gist.github.com/raw/323731/install_homebrew.rb )"

3. Install the program through homebrew
HomebrewAfter the installation is successful, the directory is automatically created/Usr/local/cellar to store the programs installed by homebrew. You can use the brew command in the command line status.
Use brew install to install the software,

You can use brew search to search for programs, such as brew search Vim. You can search for programs with names including vim.

4. Update the package
Through brew update, you can update the package information to the latest version. However, the package update is implemented by using the GIT command. Therefore, you must first install git using the brew install git command.

5. Other commands
Brew List displays installed packages
Brew home [] Open the related package page in a browser
Brew info [] display package information
Brew deps [] display package Dependencies
Brew server starts the Web server and can access http: // localhost: 4567/in a browser to manage packages on the same webpage.
Brew-H brew help



The Brew command

Useman brewTo view the manpage.

Command Description
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 whereformulaIs 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 fileurl, Then open it in$BREW_EDITOROr$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 doformula
brew create --macports [formula] Open macports 'search page in your browser, so you can see how they doformula
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_EDITOROr$EDITOR
brew fetch --force -v --HEAD [formula] Download source packageformula; For tarbils, also prints MD5 andsha1Checksums
brew home Open homebrew's homepage in your browser
brew home [formula] Opensformula'S homepage in your browser
brew info Print Summary of installed packages
brew info [formula] Print infoformula(Regardless of whetherformulaIs Installed)
brew info --github [formula] Open GitHub's history pageformulaIn your browser
brew install [formula] Installformula
brew install --HEAD [formula] InstallHEADVersionformula(If its formula definesHEAD)
brew install --force --HEAD [formula] Install a newerHEADVersionformula(If its formula definesHEAD)
brew link [formula] Symlink all installed filesformulaInto the Homebrew prefix3
brew list [formula] List all installed filesformula(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 formulaWill install the newer version)
brew prune Remove dead symlinks from homebrew's prefix4
brew remove [formula] Uninstallformula
brew search List all available Formula
brew search [formula] SearchformulaIn all available Formulae
brew search /[formula]/ Search/formula/(As RegEx) in all available Formulae
brew unlink [formula] UnsymlinkformulaFrom 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 -rfIt; 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 installed med when installing formulae. It's useful fordiy installation, or swapping out versions of a package you have multiple installof.

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

[Switch] homebrew-OSX simple package management system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.