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.
31 Responses to Install wget on OS X Lion
Evan November 6, 2011 Reply
How are we supposed to wget the file if we don’t have it…
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.
Tom December 7, 2011 Reply
Worked like a charm on Snow Leopard! Thank you!!
Ventola December 10, 2011 Reply
thanks very much for the openssl parameter, was supposed install gnutls libraries separately and found your post, thanks again.
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!
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.
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!
Ethan February 27, 2012 Reply
Thanks Tom! Worked perfectly.
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?
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.
Joeri March 27, 2012 Reply
In Xcode 4.3 there is an option to download and install command line tools in the Preference panel.
Yann Charlou April 13, 2012 Reply
Lauch XCode, go to Préférences then Downloads.
Clic install on “Command line tools”.
That’s all.
redsai March 5, 2012 Reply
Thanks for this. It was exactly what I needed, when I needed it.
Hossein March 15, 2012 Reply
helped! Thanks
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.
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.
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.
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.
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.
BertoFett April 30, 2012 Reply
echo ‘alias wget=”curl -O”‘ >> ~/.bash_profile
log out and log back in.
Boom.
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.
TJ May 1, 2012 Reply
Thanks! Worked brilliantly!
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…..
Thomas Hunter May 6, 2012 Reply
Nice catch… WordPress keeps breaking line breaks in old posts, and I have no idea why.
Vidar Andersen May 6, 2012 Reply
Thank you Thomas! Worked like a charm on Lion.
Rob Ray May 18, 2012 Reply
Thanks man! worked great.
Paul Mulroney June 2, 2012 Reply
Thanks for your post – worked first time!
Tim Kenington June 3, 2012 Reply
Thanks so much for your post – it was a huge time saver to have stumbled across your solution!
Peter Evans June 6, 2012 Reply
Worked like a charm on my MacBook Air with Lion 10.7.4. Thanks very much.
smronju