WGET ¶
Mac provides curl
, however sometime using wget
is more handy. This post is for installing wget
for Mac. by following the below mentined steps:
Method 1¶
In most of tutorials, installing wget
using curl
is recommended . However I ran into several issues using this approach. I will share it with you guys. First you need to install the xcode command line tools
, easiest way to do so by running in the Terminal
xcode-select --install
- Download
wget
usingcurl
curl -O http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
- Unpack it using
tar -zxvf wget-1.15.tar.gz
- cd to folder using
cd wget-1.15/
./configure
I have got following error that
Error
configure: error: --with-ssl=gnutls was given, but GNUTLS is not available.
we can skip this error using
./configure --with-ssl=openssl
However, this also leads to another error shown below
configure: error: --with-ssl=openssl was given, but SSL is not available
Method 2¶
- We can easily go around aforementioned error as
brew
will automatically install dependencies forwget
andopenssl
. Gor doing this you must havebrew
installed
brew install wget
as shown below, it will automatically download the dependency
==> Installing dependencies for wget: openssl
==> Installing wget dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2j.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2j.sierra.bottle.tar.gz
- For checking is
wget
is installed successfully, pleasecd
to paricular folder and enter
wget -O sample.txt http://www.gutenberg.org/cache/epub/1787/pg1787.txt
text will be generated from link http://www.gutenberg.org/cache/epub/1787/pg1787.txt
and saved as sample.txt
Success
Congrats, we have successfully installed wget on mac.If you have some issues or suggestions, please feel free to comment below.