沒有Wget的日子是非常難過的,強大的Mac OS 下安裝Wget非常簡單
下載一個Wget的源碼包,http://www.gnu.org/software/wget/
安裝與配置
1. 首先下載一個Wget的源碼包
http://www.gnu.org/software/wget/
2. 進入到解壓的目錄
tar zxvf wget-1.9.1.tar.gz
3. 輸入:./configure
末尾幾行執行結果:
...
configure: error: in `/Users/Richard/Documents/Dev/tools/wget-1.17': configure: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GNUTLS_CFLAGS and GNUTLS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See `config.log' for more details
為解決此問題
1)在命令行運行
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2)安裝中會有提示
Press RETURN to continue or any other key to abort ==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig /usr/local/share /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/doc Password:
直接回車
3)安裝完畢
...
From https://github.com/Homebrew/homebrew * [new branch] master -> origin/master HEAD is now at b3139f3 test-bot: allow tapuser/taprepo/tapformula format. ==> Installation successful! ==> Next steps Run `brew help` to get started
4)安裝wget
$ brew install wget
5)安裝結束
...
==> Summary 🍺 /usr/local/Cellar/openssl/1.0.2e: 465 files, 17M ==> Installing wget ==> Downloading https://homebrew.bintray.com/bottles/wget-1.17.yosemite.bottle.1 ######################################################################## 100.0% ==> Pouring wget-1.17.yosemite.bottle.1.tar.gz 🍺 /usr/local/Cellar/wget/1.17: 9 files, 1.6M
如果使用brew安裝wget,以下4、5可以略去。
4. 輸入:make
5. 輸入:sudo make install
有圖有真相
結束
另外一種方式
1 輸入:tar zxvf wget-1.9.1.tar.gz
2 cd 進入到解壓的目錄
3 輸入:./configure
4 輸入:make
5 輸入:sudo make install