Homebrew on Mac uses--homebrew to make OS X more complete

Source: Internet
Author: User
Tags install homebrew openssl

What is 0 homebrew?

"Homebrew installs the stuff you need so Apple didn ' t.--homebrew makes OS X more complete."

Homebrew's official website [1] (Multi-lingual version) provides a simple and concise description of how to install and use this tool and provide your own wiki.

1 Installing Homebrew

The installation of brew is simple, with a ruby command, and Ruby is already installed on the MAC system by default.

Gerryyang@mba:bin$ruby--version
Ruby 2.0.0p247 (2013-06-27 revision 41674) [Universal.x86_64-darwin13]

For detailed instructions on installing brew, refer to the wiki instructions on GitHub [2]:

"
Installation

The suggested and easiest-to-install Homebrew is on the homepage. We don ' t duplicate it's here because it's asecurity risk to list it on a user-editable wiki.

The standard script installs Homebrew to/usr/localso this you don't need sudo when youbrew install. It is acareful script, the It can be run even if you have stuff installed To/usr/localalready. It tells exactly what it would do before itdoes it too. And you had to confirm everything it would do before itstarts.

There is other ways to the install Homebrew which provide you with moreflexibility. They is listed below the requirements.

"

    1. Gerryyang@mba: ~ $ruby-E "$ (curl-fssl https://raw.github.com/Homebrew/homebrew/go/install)"
    2. It appears Homebrew is already installed. If your intent is to reinstall you
    3. Should do the following before running this installer again:
    4. Rm-rf/usr/local/cellar/usr/local/.git && Brew Cleanup


Since brew is already installed on my system, executing the installation command again will prompt me that brew already exists.

2 Usage of homebrew

To view the specific uses of brew:

  1. Gerryyang@mba: ~ $brew
  2. Example usage:
  3. Brew [INFO | home | options] [FORMULA ...]
  4. Brew Install FORMULA ...
  5. Brew Uninstall FORMULA ...
  6. Brew Search [foo]
  7. Brew list [FORMULA ...]
  8. Brew Update
  9. Brew upgrade [FORMULA ...]
  10. Brew Pin/unpin [FORMULA ...]
  11. Troubleshooting:
  12. Brew Doctor
  13. Brew INSTALL-VD FORMULA
  14. Brew [--env |--config]
  15. Brewing:
  16. Brew Create [URL [--no-fetch]]
  17. Brew edit [FORMULA ...]
  18. Open Https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook
  19. Further help:
  20. Mans Brew
  21. Brew Home
  22. Gerryyang@mba: ~$

3 Interesting questions about homebrew

Here are some common questions about homebrew [3]:

(1) In OS X cannot find the desired software, you can use the brew installation;

  1. Gerryyang@mba: ~ $brew Install wget
  2. ==> Downloading http://ftpmirror.gnu.org/wget/wget-1.14.tar.gz
  3. ######################################################################## 100%
  4. ==>./configure--prefix=/usr/local/cellar/wget/1.14--sysconfdir=/usr/local/etc
  5. ==> make Install
  6. Warning:could not link wget. Unlinking ...
  7. Error:the ' Brew link ' step did not complete successfully
  8. The formula built, but was not symlinked into/usr/local
  9. You can try again using ' Brew link wget '
  10. Possible conflicting files are:
  11. /usr/local/bin/wget
  12. /usr/local/share/man/man1/wget.1
  13. ==> Summary
  14. <span style= "font:13.0px Monaco" >/usr/local/cellar/wget/1.14:8 files, 688K, built in 2.3 minutes</span>

Since the wget was previously installed using the source code method, a conflicting error will be prompted with the brew installation because/usr/locat/bin/wget already exists. In fact, Homebrew the package into a separate directory (/usr/local/cellar) and then symlink to/usr/local.

(2) How do I update a locally installed package?

First step: Update Brew First:

Brew Update

    1. [Email Protected]:bin$brew Update
    2. Already up-to-date.


Step Two: Update all package:
Brew Upgarde

  1. [Email protected]:bin$brew upgrade
  2. ==> upgrading 1 Outdated package with result:
  3. wget 1.15
  4. ==> Upgrading wget
  5. ==> Installing wget Dependency:openssl
  6. ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/openssl-1.0
  7. ######################################################################## 100%
  8. ==> Pouring openssl-1.0.1f.mavericks.bottle.tar.gz
  9. ==> Caveats
  10. This formula are keg-only, so it's not symlinked into/usr/local.
  11. Mac OS X already provides this software and installing another version in
  12. Parallel can cause all kinds of trouble.
  13. The OpenSSL provided by OS X are too old for some software.
  14. Generally there is no consequences of this. If You build your
  15. Own software and it requires this formula, you'll need to the add to your
  16. Build variables:
  17. Ldflags:-l/usr/local/opt/openssl/lib
  18. Cppflags:-i/usr/local/opt/openssl/include
  19. ==> security find-certificate-a-p/library/keychains/system.keychain > '/usr/l
  20. ==> Security Find-certificate-a-p/system/library/keychains/systemrootcertific
  21. ==> mv-f/usr/local/etc/openssl/osx_cert.pem.tmp/usr/local/etc/openssl/osx_cer
  22. ==> Summary
  23. /usr/local/cellar/openssl/1.0.1f:429 files, 15M
  24. ==> Installing wget
  25. ==> Downloading http://ftpmirror.gnu.org/wget/wget-1.15.tar.gz
  26. ######################################################################## 100%
  27. ==>./configure--prefix=/usr/local/cellar/wget/1.15--sysconfdir=/usr/local/etc--with-ssl=openssl-- With-libssl-prefix=/usr/local/opt/openssl--disable-iri
  28. ==> make Install
  29. Warning:could not link wget. Unlinking ...
  30. Error:the ' Brew link ' step did not complete successfully
  31. The formula built, but was not symlinked into/usr/local
  32. You can try again using ' Brew link wget '
  33. Possible conflicting files are:
  34. /usr/local/bin/wget
  35. /usr/local/share/man/man1/wget.1
  36. ==> Summary
  37. /usr/local/cellar/wget/1.15:8 files, 700K, built in seconds
  38. [Email protected]:bin$

(3) How to delete homebrew?

If you installed to/usr/localthen your can use the script on Thisgist to uninstall-it would onlyremove Homebrew and the St Uff Homebrew installed leaving anything elsein/usr/localalone.

Provided haven ' t put anything else in Homebrew ' s prefix (brew--prefix), you can generally justrm-rfthat directory. Thisis because Homebrew won ' t touch files outside its prefix.


(4) Where is the path of the package stored by homebrew download?

    1. [email protected]:bin$brew --cache  
    2. /library/caches/homebrew  
    3. [email protected]:bin$ls /library/caches/homebrew/  
    4. formula/                                  wget-1.14.tar.gz  
    5. coreutils-8.22.tar.xz                   wget-1.15.tar.gz  
    6. openssl-1.0.1f.mavericks.bottle.tar.gz   xz-5.0.5.mavericks.bottle.2.tar.gz  
    7. [email protected]:bin$ls /library/ caches/homebrew/formula/  
    8. coreutils.brewing  openssl.brewing   wget.brewing  xz.brewing  
    9.   
    10. [email protected]:bin$   

(5) Can I install my own stuff in/usr/local?

Yes, Brew is designed-not get-in your-on-the-youlike.

Install your own stuff, but being aware that if you install commonlibraries, like libexpat yourself, it may cause trouble whe n trying tobuild certain Homebrew formula. As a resultbrew Doctorwill warn Youabout this.

Thus it ' s probably better to install your own stuff to the Cellar andthenbrew Linkit. Like so:

$ cd foo-0.1 $ brew diy./configure —prefix=/usr/local/Cellar/foo/0.1 $ ./configure —prefix=/usr/local/Cellar/foo/0.1 [snip] $ make && make install $ brew link fooLinking /usr/local/Cellar/foo/0.1… 17 symlinks created

Detection in my environment is like this:

  1. [Email Protected]:bin$brew doctor
  2. Warning:unbrewed dylibs were found in/usr/local/lib.
  3. If you didn ' t put them there on purpose they could cause problems when
  4. Building Homebrew formulae, and may need to be deleted.
  5. Unexpected dylibs:
  6. /usr/local/lib/libboost_atomic.dylib
  7. /usr/local/lib/libboost_chrono.dylib
  8. /usr/local/lib/libboost_context.dylib
  9. /usr/local/lib/libboost_date_time.dylib
  10. /usr/local/lib/libboost_filesystem.dylib
  11. /usr/local/lib/libboost_graph.dylib
  12. /usr/local/lib/libboost_iostreams.dylib
  13. /usr/local/lib/libboost_locale.dylib
  14. /usr/local/lib/libboost_log.dylib
  15. /usr/local/lib/libboost_math_c99.dylib
  16. /usr/local/lib/libboost_math_c99f.dylib
  17. /usr/local/lib/libboost_math_c99l.dylib
  18. /usr/local/lib/libboost_math_tr1.dylib
  19. /usr/local/lib/libboost_math_tr1f.dylib
  20. /usr/local/lib/libboost_math_tr1l.dylib
  21. /usr/local/lib/libboost_prg_exec_monitor.dylib
  22. /usr/local/lib/libboost_program_options.dylib
  23. /usr/local/lib/libboost_python.dylib
  24. /usr/local/lib/libboost_random.dylib
  25. /usr/local/lib/libboost_regex.dylib
  26. /usr/local/lib/libboost_serialization.dylib
  27. /usr/local/lib/libboost_signals.dylib
  28. /usr/local/lib/libboost_system.dylib
  29. /usr/local/lib/libboost_thread.dylib
  30. /usr/local/lib/libboost_timer.dylib
  31. /usr/local/lib/libboost_unit_test_framework.dylib
  32. /usr/local/lib/libboost_wave.dylib
  33. /usr/local/lib/libboost_wserialization.dylib
  34. Warning:unbrewed static libraries were found in/usr/local/lib.
  35. If you didn ' t put them there on purpose they could cause problems when
  36. Building Homebrew formulae, and may need to be deleted.
  37. Unexpected static libraries:
  38. /usr/local/lib/libboost_atomic.a
  39. /usr/local/lib/libboost_chrono.a
  40. /usr/local/lib/libboost_context.a
  41. /usr/local/lib/libboost_coroutine.a
  42. /usr/local/lib/libboost_date_time.a
  43. /usr/local/lib/libboost_exception.a
  44. /usr/local/lib/libboost_filesystem.a
  45. /usr/local/lib/libboost_graph.a
  46. /usr/local/lib/libboost_iostreams.a
  47. /usr/local/lib/libboost_locale.a
  48. /usr/local/lib/libboost_log.a
  49. /usr/local/lib/libboost_math_c99.a
  50. /usr/local/lib/libboost_math_c99f.a
  51. /usr/local/lib/libboost_math_c99l.a
  52. /usr/local/lib/libboost_math_tr1.a
  53. /usr/local/lib/libboost_math_tr1f.a
  54. /usr/local/lib/libboost_math_tr1l.a
  55. /usr/local/lib/libboost_prg_exec_monitor.a
  56. /usr/local/lib/libboost_program_options.a
  57. /usr/local/lib/libboost_python.a
  58. /usr/local/lib/libboost_random.a
  59. /usr/local/lib/libboost_regex.a
  60. /usr/local/lib/libboost_serialization.a
  61. /usr/local/lib/libboost_signals.a
  62. /usr/local/lib/libboost_system.a
  63. /usr/local/lib/libboost_test_exec_monitor.a
  64. /usr/local/lib/libboost_thread.a
  65. /usr/local/lib/libboost_timer.a
  66. /usr/local/lib/libboost_unit_test_framework.a
  67. /usr/local/lib/libboost_wave.a
  68. /usr/local/lib/libboost_wserialization.a
  69. Warning:you has unlinked kegs in your Cellar
  70. Leaving kegs unlinked can leads to build-trouble and cause brews this depend on
  71. Those kegs to fail to run properly once built. Run ' Brew link ' on these:
  72. Wget
  73. [Email protected]:bin$

(6) Why choose the name homebrew?
MXCL is too concerned with the beer theme and didn ' t consider, that the project may actually prove popular. By the time he realized it is too late. However, today, the first Google hit for "homebrew" are not beer related;-)


(7) For more QA can refer to Homebrew's wiki[4]

(8) Some common installation recommendations

    1. [Email protected]:bin$brew list
    2. Coreutils OpenSSL wget XZ

Introduction to Coreutils

The GNU Core Utilities is the basic file, shell and text manipulationutilities of the GNU operating system.
These is the core Utilitieswhich is expected to exist on every operating system.

http://www.gnu.org/software/coreutils/

4 references

[1] http://brew.sh/index_zh-cn.html

[2] https://github.com/Homebrew/homebrew/wiki/Installation

[3] Https://github.com/Homebrew/homebrew/wiki/FAQ

[4] Https://github.com/Homebrew/homebrew/wiki

Homebrew on Mac uses--homebrew to make OS X more complete

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.