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
- 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
- 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
- sudo vim/usr/local/library/homebrew/utils.rb
[Ruby]View Plaincopy
- 135 def Curl *args
- 136 Curl = Pathname. new '/usr/bin/curl '
- 137 Raise "#{curl} is not executable" unless curl.exist? and curl.executable?
- 138
- 139 args = [Homebrew_curl_args, homebrew_user_agent, *args]
- # See https://github.com/mxcl/homebrew/issues/6103
- 141 args << "--insecure" if macos.version < "10.6"
- 142 args << "--verbose" if env[' homebrew_curl_verbose ']
- 143 args << "--silent" unless $stdout. TTY?
- 144
- 145 Safe_system Curl, *args
- 146 End
Modify 139 Rows plus the-k parameter
[Ruby]View Plaincopy
- 139 args = [Homebrew_curl_args, homebrew_user_agent,'-K ', *args]
[Turn]mac OSX under Apt-get,yum's replacement tool----homebrew