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.

26 Responses to Install wget on OS X Lion
  1. Evan Reply

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

    • Thomas Hunter 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. Tom Reply

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

  3. Ventola Reply

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

  4. Paul Demers 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!

    • Thomas Hunter 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. William Reply

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

  6. Ethan Reply

    Thanks Tom! Worked perfectly.

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

    • Thomas Hunter 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.

      • Joeri Reply

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

      • Yann Charlou Reply

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

        That’s all.

  8. redsai Reply

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

  9. Hossein Reply

    helped! Thanks

  10. Dave Reply

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

  11. Gary 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. Nate 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. Ted 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. [...] http://thomashunter.name/blog/install-wget-on-os-x-lion/ [...]... geniustechblog.com/wget-on-os-x-lion
  15. Ringel 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. BertoFett Reply

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

    log out and log back in.

    Boom.

    • Thomas Hunter 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. TJ Reply

    Thanks! Worked brilliantly!

  18. ambarish 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…..

    • Thomas Hunter Reply

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

  19. Vidar Andersen Reply

    Thank you Thomas! Worked like a charm on Lion.

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.

*

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>