Install wget on OS X Lion

A pre-requisite for this to work is that you have the second disc of utilities that came with your Mac installed. This disc will provide a bunch of utilities required to compile code. Alternatively, you can Install Xcode from the App Store (it’s free!) and you will get all of the same utilities.

UPDATE: Installing Xcode is no longer good enough.You will now need to open Xcode, go to preferences (Cmd + ,), go to Downloads, and install the Command Line Tools feature. This installs a bunch of development tools onto your system.

Run the following commands in a terminal window to compile wget on OS X Lion:

curl -O ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz
tar -xzvf wget-1.13.4.tar.gz
cd wget-1.13.4
./configure --with-ssl=openssl
make
sudo make install
which wget #Should output: /usr/local/bin/wget

Note the with-ssl=openssl option in the command above. If you omit that, you will get the following error:

...
checking for compress in -lz... yes
checking for gpg_err_init in -lgpg-error... no
checking for gcry_control in -lgcrypt... no
checking for libgnutls... no
configure: error: --with-ssl was given, but GNUTLS is not available.
username@host:~/wget-1.13.4 $

The reason for this is that GNUTLS isn’t included with Mac OS X, but the equally usable library OpenSSL is available.

Posted by Thomas Hunter OS X Permalink
Really simple SSH proxy (SOCKS5) Tumblr-like Template Syntax PHP Library
31 Responses to Install wget on OS X Lion
  1. spacer

    Evan November 6, 2011 Reply

    How are we supposed to wget the file if we don’t have it…

    • spacer

      Thomas Hunter November 10, 2011 Reply

      Thanks for spotting it! I had aliased ‘wget’ to ‘curl -O’ in my .bash_profile. I updated the tutorial to use the proper command.

  2. spacer

    Tom December 7, 2011 Reply

    Worked like a charm on Snow Leopard! Thank you!!

  3. spacer

    Ventola December 10, 2011 Reply

    thanks very much for the openssl parameter, was supposed install gnutls libraries separately and found your post, thanks again.

  4. spacer

    Paul Demers December 26, 2011 Reply

    It is also important to note that you need to have Xcode installed in order to run the make command. I had a little bit of trouble until I figured that out. Thanks for the tutorial!

    • spacer

      Thomas Hunter February 22, 2012 Reply

      Good point, I’ve started taking for granted that the machines I use have Xcode installed since I’ve been using them in pre-installed environments.

  5. spacer

    William February 21, 2012 Reply

    Thanks a ton for the quick guide. Brand new to OSX, and didn’t realize that OpenSSL was the default SSL Package!

  6. spacer

    Ethan February 27, 2012 Reply

    Thanks Tom! Worked perfectly.

  7. spacer

    George March 3, 2012 Reply

    I’ve Xcode installed, but this error is happened:

    checking for gcc… no
    checking for cc… no
    checking for cl.exe… no
    configure: error: in `/Users/qqq/wget-1.13′:
    configure: error: no acceptable C compiler found in $PATH
    See `config.log’ for more details
    Qqq:wget-1.13 qqq$

    What kind of compiler i must using in OS Lion?

    • spacer

      Thomas Hunter March 11, 2012 Reply

      If you have Xcode, you should have gcc. I’m not sure why you wouldn’t have gcc. You might want to try installing the development tools which are on the second CD that came with your mac.

      • spacer

        Joeri March 27, 2012 Reply

        In Xcode 4.3 there is an option to download and install command line tools in the Preference panel.

      • spacer

        Yann Charlou April 13, 2012 Reply

        Lauch XCode, go to Préférences then Downloads.
        Clic install on “Command line tools”.

        That’s all.

  8. spacer

    redsai March 5, 2012 Reply

    Thanks for this. It was exactly what I needed, when I needed it.

  9. spacer

    Hossein March 15, 2012 Reply

    helped! Thanks

  10. spacer

    Dave March 25, 2012 Reply

    Thx for this…. “./configure –with-ssl=openssl”. I was pretty bummed about the prospect of having to use wget w/o SSL.

  11. spacer

    Gary March 28, 2012 Reply

    The current version of Xcode no longer includes the command-line compilers and tools. These are a separate package that must be installed.

  12. spacer

    Nate March 30, 2012 Reply

    For those running Lion and installing Xcode, once Xcode is installed you will need to then go to preferences and downloads and click install for command line tools. If you don’t then you will get the gcc no acceptable c compiler found error.

  13. spacer

    Ted April 12, 2012 Reply

    If you install Xcode through the Mac App Store, you will not have the command line compilers installed. It is a separate download from Apple. Inside Xcode, got to Xcode > Open Developer Tool > More Developer Tools. That will launch the ADC website. Login, and download the Command Line Tools for Xcode (the latest version). That should give you the C compiler.

  14. Trackback: wget on OS X Lion | Genius Tech Blog
    [...] thomashunter.name/blog/install-wget-on-os-x-lion/ [...]... geniustechblog.com/wget-on-os-x-lion
  15. spacer

    Ringel April 30, 2012 Reply

    OsX gets worse and worse.
    In the past cam wget with it, on Lion not anymore.
    If I I need to drop a bunch of commands, I can also work on Linux… do that, read MAN page there and so on…

    Stuck on not having the make command/file on the machine. I can solve that, but not sure if I want to invest time to it.
    Expecting installer packages and not crappy command based installations.

  16. spacer

    BertoFett April 30, 2012 Reply

    echo ‘alias wget=”curl -O”‘ >> ~/.bash_profile

    log out and log back in.

    Boom.

    • spacer

      Thomas Hunter May 1, 2012 Reply

      That alias will work for the simple uses of wget, but anything more complex (e.g. using different wget arguments) will fail. I was actually doing before making the jump and fully installing wget.

  17. spacer

    TJ May 1, 2012 Reply

    Thanks! Worked brilliantly!

  18. spacer

    ambarish May 5, 2012 Reply

    Thanks! Worked nicely! When I look at your command line, you don’t seem the have the commands separated by ; (not sure if this is because I am using Chrome, but I see a single command, rather than a series of commands…..

    • spacer

      Thomas Hunter May 6, 2012 Reply

      Nice catch… WordPress keeps breaking line breaks in old posts, and I have no idea why.

  19. spacer

    Vidar Andersen May 6, 2012 Reply

    Thank you Thomas! Worked like a charm on Lion.

  20. spacer

    Rob Ray May 18, 2012 Reply

    Thanks man! worked great.

  21. spacer

    Paul Mulroney June 2, 2012 Reply

    Thanks for your post – worked first time!

  22. spacer

    Tim Kenington June 3, 2012 Reply

    Thanks so much for your post – it was a huge time saver to have stumbled across your solution!

  23. spacer

    Peter Evans June 6, 2012 Reply

    Worked like a charm on my MacBook Air with Lion 10.7.4. Thanks very much.

  24. spacer

    smronju