brew軟體包管理利器
最近編譯Spark的時候,遇到一個問題:
執行SPARK_HADOOP_VERSION=0.20.2-cdh3u5 SPARK_HIVE=true sbt/sbt assembly後,報錯:
error: Protocol https not supported or disabled in libcurl while accessing https://github.com/apache/spark.git/info/refs
fatal: HTTP request failed
是在git clone的時候出了問題,懷疑是curl不支援https,在我檢查後發現,curl是支援https的。
那就把問題定位到了,git,git在編譯的時候估計libcurl是不支援https的。
手工修複的成本太大,修複了很久,這是搜到了一篇stackoverflow討論此issues的文章:http://stackoverflow.com/questions/19015282/how-do-i-enable-https-support-in-libcurl
評論裡有人提到用brew doctor,這個只有Mac OS才有這個軟體。不過Linux平台也有移植版linuxbrew
brew是一個類似apt-get, yum 的安裝工具包。支援的特性如下:
- Can install software to a home directory and so does not require sudo
- Install software not packaged by the native distribution
- Install up-to-date versions of software when the native distribution is old
- Use the same package manager to manage both your Mac and Linux machines
- Linuxbrew 允許將包安裝到使用者的 HOME 目錄,這樣的話,就不再 需要執行 sudo;
- 對於在 Linux 包管理器中缺少的包,可以通過 Linuxbrew 來搞定;
- 如果 Linux 包管理器中所帶包的版本過舊,那麼利用 Linuxbrew 能夠安裝該包的最新版本。
一、安裝linuxbrew: 安裝就從git clone下來,然後配置環境變數如下:git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrewexport PATH="$HOME/.linuxbrew/bin:$PATH"export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH"
二、重新安裝git: 刪除了Git,重新用linuxbrew來安裝git:[root@wh-8-210 shengli]# brew install git --with-brewed-curl ==> Installing dependencies for git: pkg-config, makedepend, openssl, curl==> Installing git dependency: pkg-config==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz......
問題解決。參考: http://www.linuxeden.com/html/news/20140312/149399.html https://github.com/Homebrew/linuxbrew原創文章:轉載請註明出自:http://blog.csdn.net/oopsoom/article/details/39231091