[Turn]mac OSX under Apt-get,yum's replacement tool----homebrew

Source: Internet
Author: User
Tags ssl certificate

Original address: http://blog.csdn.net/tsxw24/article/details/15500517

Linux has a very convenient package manager, such as: Apt-get, Yum,mac also have similar tools: Homebrew and Fink, Macport.

Flink is directly compiled binary package, MacPorts is to download all dependent library source code, local compilation installs all dependencies, homebrew is try to find the local dependent library, and then download the package source code to compile the installation.


Flink prone to rely on library issues, macports equivalent to build a set of their own, download and compile things too much too cumbersome, homebrew the most reasonable way.

Homebrew Install command, the Mac comes with Ruby, enter the following command at the terminal, follow the prompts to install

[Plain]View Plaincopy
    1. Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"

Ps:http://brew.sh/index_zh-cn.html

From Ubuntu to Mac, the most annoying is that no zssh can be used, let me remotely log in to transfer files is very inconvenient, now good, the following command can be installed ZSSH

[Plain]View Plaincopy
    1. Brew Install Zssh Lrzsz

Reference: http://brew.sh/index_zh-cn.html

Add: HTTPS Download failed resolution

Homebrew uses curl to download files, and some are downloaded using an HTTPS connection. However, due to the network environment or some other reason, the HTTPS certificate authentication failed and could not be downloaded

If I visit https://webp.googlecode.com, I will report a certificate error.

The "-k" option for Curl resolves this issue and is downloaded directly without checking SSL certificate security, which can pose some security risks.

But if you trust homebrew enough, you can change its source to curl plus the "-k" option, as follows:

[Plain]View Plaincopy
    1. sudo vim/usr/local/library/homebrew/utils.rb

[Ruby]View Plaincopy
  1. 135 def Curl *args
  2. 136 Curl = Pathname. new '/usr/bin/curl '
  3. 137 Raise "#{curl} is not executable" unless curl.exist?  and curl.executable?
  4. 138
  5. 139 args = [Homebrew_curl_args, homebrew_user_agent, *args]
  6. # See https://github.com/mxcl/homebrew/issues/6103
  7. 141 args << "--insecure" if macos.version < "10.6"
  8. 142 args << "--verbose" if env[' homebrew_curl_verbose ']
  9. 143 args << "--silent" unless $stdout. TTY?
  10. 144
  11. 145 Safe_system Curl, *args
  12. 146 End

Modify 139 Rows plus the-k parameter

[Ruby]View Plaincopy
      1. 139 args = [Homebrew_curl_args, homebrew_user_agent,'-K ', *args]

[Turn]mac OSX under Apt-get,yum's replacement tool----homebrew

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.