MAC - Homebrew introduction and use

 

First, what is the Homebrew

Homebrew is the package management tool under Mac OS platform, with install, uninstall, update, view, search, and many other useful features. A simple instruction, the package management can be achieved, but do not you care what happens to the various dependencies and file path, very convenient.

Quoted the official word: it has suggested that the lack kit? Do not worry, Homebrew waiting at any time. Homebrew - OS X indispensable kit manager.

Two, Homebrew Installation

1. Requirements

  • Intel CPU

  • OS X 10.9 or higher

  • Xcode command-line tool
$ Xcode-select --install support shell (sh or bash)
  • Support shell (sh or bash)

2. Install and Uninstall

  • installation
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Uninstall

 

$ cd `brew --prefix`
$ rm -rf Cellar
$ brew prune
$ rm `git ls-files`
$ rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
$ rm -rf .git
$ rm -rf ~/Library/Caches/Homebrew

Three, Homebrew basic use

  • Install any package

    Example: Installation node

    
    
  • Uninstall any package

    Example: Uninstall git

    
    
  • Query packages available

  • View the list of installed packages

     
       
  • View any package information

  • Homebrew Update

    
    
  • View Homebrew version

  • Homebrew Help

Fourth, pay attention

After Mac OS X 10.11 system, read and write files in / usr / local / etc directory system is the system needs root privileges, previous Homebrew installed If you do not specify the installation path, installed by default in the root user read and write permissions on these systems need directory, resulting in the need to add some command sudo prefix to perform, such as upgrade Homebrew need:


If you do not want to use the sudo command every time, you have two ways to choose:

  1. For the / usr file read and write in the local directory / users authorized to carry out root

    
    

    Example:

    
    
  2. (Recommended) Homebrew specified during installation of the installation path, the system need not be installed directly under the root user can freely read and write authorization directory

    
    
 
 

Guess you like

Origin www.cnblogs.com/hecheng123/p/12037832.html