«

»

Print this Post

How to install wget in Mac OS X

wget is a really handy command line utility, but unfortunately not included in OS X. Curl could be a suitable replacement, but frequently scripts are written with wget, and it can be difficult and time-consuming to convert them to using curl.

Below are the steps required to install a working wget on Mac OS X. This has been tested on OS X 10.6 Lion.

Install XCode from http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 (at this time, it’s a 1.5GB download.)

Launch XCode, updating if necessary.

Go to Preferences > Downloads, and install Command Line Tools

Now open a terminal and perform the following steps at the command line one at a time to download, extract, configure, compile, and install wget:

curl -O http://ftp.gnu.org/gnu/wget/wget-1.14.tar.gz
tar xvzf wget-1.14.tar.gz
cd wget-1.14
./configure --with-ssl=openssl
make
sudo make install

You should now have a working wget installed in /usr/local/bin. Confirm by trying

$ wget
wget: missing URL
Usage: wget [OPTION]... [URL]...
Try `wget --help' for more options.

Feel free to comment below. Thanks!

Permanent link to this article: http://mikebeach.org/2012/09/29/how-to-install-wget-in-mac-os-x/

4 comments

Skip to comment form

  1. gulli

    Mike,

    Thanks for the info.

    I followed your instructions to install wget
    but this is what I get:
    -bash: wget: command not found

    I tried it twice, thinking that the initial try that I had done in the Downloads folder may have been the cause but not.
    Also, the curl command does not relaly download the file from the GNU ftp site.
    It downloads a file that cannot be unzipped (only 308 bytes in size).
    I used the browser to get the correct file…

    Thanks again.

    Gulli

    1. Mike

      Might be an issue with curl, but I don’t think so. It worked when I tried it.

      Anyone else having this issue?

  2. Barry

    Had the same thing when I copied and pasted straight from the page.
    Roll over the 6 numbered lines and on the right 4 icons appear, click the first one “view source” and copy the lines one at a time from there.
    I guess the copied text needs to be clean…?

    Hope that helps you too ;)

  3. Dheeraj

    Having some issues:
    [13:52:14] dkhanna@MacBookPro1:~/Documents/abcd
    $ cd wget-1.14
    [13:52:21] dkhanna@MacBookPro1:~/Documents/abcd/wget-1.14
    $ sudo ./configure –with-ssl=openssl
    configure: configuring for GNU Wget 1.14
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for a thread-safe mkdir -p… build-aux/install-sh -c -d
    checking for gawk… no
    checking for mawk… no
    checking for nawk… no
    checking for awk… awk
    checking whether make sets $(MAKE)… no
    checking build system type… i386-apple-darwin12.3.0
    checking host system type… i386-apple-darwin12.3.0
    checking for gcc… no
    checking for cc… no
    checking for cl.exe… no
    configure: error: in `/Users/dkhanna/Documents/abcd/wget-1.14′:
    configure: error: no acceptable C compiler found in $PATH
    See `config.log’ for more details
    [13:52:41] dkhanna@MacBookPro1:~/Documents/abcd/wget-1.14
    $ sudo make
    sudo: make: command not found
    [13:53:08] dkhanna@MacBookPro1:~/Documents/abcd/wget-1.14
    $ sudo make install
    sudo: make: command not found
    [13:53:22] dkhanna@MacBookPro1:~/Documents/abcd/wget-1.14
    $

    Can you please look at this and tell me what should i do ?
    I was able to get binary for wget from internet since i didnt wanted to install xcode. Would you be able to guide me if i can complete installation using the binary directly as thats eventually what ‘make’ creates.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>