Homebrew tutorial on installing and configuring the MAC OS x system

Source: Internet
Author: User
Tags chmod mkdir

Friends with experience with Linux should know the kits for Apt-get (Debian), Yum (Rhel), Pacman (ArchLinux, lightweight Linux), which are installed online. In Mac OS There are similar, more famous is MacPorts, Homebrew. Let's now outline the installation, configuration, and use of homebrew.

(1) configuration system

Now that Mac OS X is already a 64-bit system, we sometimes have a headache telling the compiler to compile all the files to 64 bits. Typically, the default system path is/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin, and we can change a little bit to include a file that is installed through homebrew. Need to change. Bash_profile:


$ vim ~/.bash_profile

Read as follows:


# Set Architecture Flags
Export archflags= "-arch x86_64"
# ensure user-installed binaries take precedence
Export Path=/usr/local/bin: $PATH

To bring into effect:


$ . ~/.bash_profile

(2) Install Xcode Command line Tools
Install the free Xcode in the App Store. To see if Xcode is installed, enter the command:
1
$ xcode-select-p
If you receive the following prompts, you are already installed:
/applications/xcode.app/contents/developer
After downloading and installing Xcode, enter the following command at the terminal and install the necessary Xcode command line Tools for compiling the software, which contains the GCC compilers.

$ xcode-select--install

Install it in the dialog box that pops up.
Qq20141024-1

Qq20141024-2

(3) Installation homebrew

Actually very simple, you can refer to the official website installation. Since Ruby is already in the system, it can be installed with the command.


macbook-air:~ weiz$ ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script would install:
/usr/local/bin/brew
/usr/local/library/...
/usr/local/share/man/man1/brew.1

Press RETURN to continue or no other key to abort
==>/usr/bin/sudo/bin/mkdir/usr/local

Warning:improper use the sudo command could leads to data loss
Or the deletion of important system files. Please double-check your
Typing when using sudo. Type ' man sudo ' for the more information.

To proceed, enter your password, or type ctrl-c to abort.

Password:
==>/usr/bin/sudo/bin/chmod g+rwx/usr/local
==>/usr/bin/sudo/usr/bin/chgrp admin/usr/local
==>/usr/bin/sudo/bin/mkdir/library/caches/homebrew
==>/usr/bin/sudo/bin/chmod G+rwx/library/caches/homebrew
==> downloading and installing Homebrew ...
Remote:counting objects:207648, done.
Remote:compressing objects:100% (55804/55804), done.
Remote:total 207648 (Delta 150671), reused 207632 (Delta 150658)
Receiving objects:100% (207648/207648), 43.68 MiB | 793.00 kib/s, done.
Resolving deltas:100% (150671/150671), done.
From Https://github.com/Homebrew/homebrew
* [New branch] Master-> origin/master
Head are now at acff365 Perl 5.20.1:add keg_only:p Rovided_by_osx
==> installation successful!
==> Next Steps
Run ' Brew Doctor ' before you install anything
Run ' Brew help ' to get started

Installing the SOFTWARE is easy:


$ brew Install bash-completion Ssh-copy-id wget

It is useful to view software information in detail in the information listed, as well as how to configure the installed software:


$ brew Info bash-completion
 
bash-completion:stable 1.3
 
http:// bash-completion.alioth.debian.org/
 
/usr/local/cellar/bash-completion/1.3 (188 files, 1.1M) *
&NBSP
Built from source
 
from:https://github.com/mxcl/homebrew/commits/master/library/formula/ BASH-COMPLETION.RB
 
==> caveats
 
Add The following lines to your ~/.bash_profile:
  ;
If [-F $ (brew--prefix)/etc/bash_completion]; then
 
. $ (Brew--prefix)/etc/bash_completion
 
Fi
 
Homebrew ' s own bash completion script has been to
installed;
  LETION.D
 
Bash Completion has been installed to:
 
/USR/LOCAL/ETC/BASH_COMPLETION.D

Where bash-completion is a very useful software that prompts more software commands with two tabs. Ann prompts the information to install can.
more useful commands such as brew Update, brew doctor, etc. need to be groped for themselves.
The following are frequently used commands by homebrew:
Find packages: Brew search wget
Install packages: Brew install wget
List installed packages: Brew List
Delete package: Brew RE Move wget
View package information: Brew info wget
Lists the dependencies of packages: Brew deps wget
Update brew:brew update
lists obsolete packages (installed but not up to date): Brew O utdated
Update Obsolete packages (all or specified): Brew Upgrade or brew upgrade wget

Related Article

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.