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 http://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.

61 Responses to “Install wget on OS X Lion”

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

    Reply
  2. Worked like a charm on Snow Leopard! Thank you!!

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

    Reply
  4. 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!

    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.

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

    Reply
  6. Thanks Tom! Worked perfectly.

    Reply
  7. 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?

    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.

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

    Reply
  9. helped! Thanks

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

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

    Reply
  12. 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.

    Reply
  13. 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.

    Reply
  14. 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.

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

    log out and log back in.

    Boom.

    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.

      Reply
  16. Thanks! Worked brilliantly!

    Reply
  17. 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…..

    Reply
  18. Thank you Thomas! Worked like a charm on Lion.

    Reply
  19. Thanks man! worked great.

    Reply
  20. Paul Mulroney

    Thanks for your post – worked first time!

    Reply
  21. Tim Kenington

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

    Reply
  22. Peter Evans

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

    Reply
  23. Thanks for the tips. It worked with openssl :)

    Reply
  24. So simple … wish I had found your site first – only found this when trying to solve the GNUTLS issue … had cobbled together all the rest of the steps from a variety of older sites & blogs.

    Reply
  25. Thanks! Works great!

    Reply
  26. Thanks for the tutorial – this was a great help!

    Reply
  27. WTF!

    “Launch of “tar” failed: the PowerPC architecture is no longer supported.”

    Reply
  28. Thanks a lot for the detailed instructions, working great on Lion (10.7.4).

    Reply
  29. Worked great, thank you! -brewster

    Reply
  30. Thanks Thomas, I’m new to this kind of terminal action and it really helped me.

    A flawless installation on Mountain Lion here.

    Reply
  31. Thanks man, I need to wget some files with OSX and this was the first link that came up and it worked like a charm, but yes you do need Xcode installed- which i would imagine anyone reading this blog with a MAC already does

    Reply
  32. Thank you! I’m so glad u posted this! It worked well on Snow Leopard and saved me lots of time.

    Reply
  33. Thanks for the tip about Mac OS X Lion’s Xcode’s Command Line Tools feature!

    Reply
  34. Worked like a charm on Mountain Lion. Thanks!

    Reply
  35. Flawless! Thank you so much.

    Reply
  36. Brock Peters

    Awesome write up. I found it helpful. Works on Mountain Lion as well. I downloaded an even later version of wget.


    curl -O http://ftp.gnu.org/gnu/wget/wget-1.14.tar.gz

    Reply
  37. Thanks for this post. It worked without a problem on Mountain Lion and wget 1.14.

    I had to do a chmod 755 /usr/local/bin before my user account could access it though. Otherwise I would have to use SUDO each time.

    Reply
  38. You don’t need XCode to get the Command Line Utils btw, they are available as a separate download on developer.apple.com

    Reply
  39. That’s awesome! Thank you Thomas!

    Reply
  40. Thanks! Worked like a charm. I’ve downloaded the command line tools without the xcode big package.

    Reply
  41. Works like a charm with OSX 10.6.8 Snow Leopard.
    Thanks Thomas!

    Reply
  42. nice!!! very good!!! tanks

    \o\|o|/o/

    Reply
  43. Awesome tut, thanks!

    Reply
  44. Never thought about using openssl. Thanks for sharing the solution!

    Reply
  45. Great information. I was able to successfully install wget. Thanks!

    -Mike

    Reply
  46. Woo I love it when a plan comes together.

    1 – Google “install wget mac”
    2 – Visit top 5 results
    3 – Close all but the prettiest page
    4 – Follow instructions
    5 – Appreciate clever author pointing out SSL error, follow instructions again
    6 – Use wget
    7 – Give thanks to clever author.

    Thanks!

    Reply
  47. Thanks so much for these instructions. I’m an absolute n00b when it comes to working in the Terminal and your instructions were foolproof.

    Reply
  48. Hey Thomas, Just wanted to say thanks for posting this as I too had to go through this after a recent Snow Leopard upgrade. However, I just discovered HomeBrew through github, and the very first thing they demonstrate what it can do is to install wget, which (no offense) seems like perhaps the simplest way to install wget as it completely bypasses XCode (which I don’t use currently) and is blazingly simple. Posting here in the hopes that it helps

    http://mxcl.github.com/homebrew/

    Reply
  49. Sweet. Thanks. It’s a pretty key program on Linux and I was starting to miss it on my Mac.

    Reply

Comment

  • (will not be published)

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