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.
How are we supposed to wget the file if we don’t have it…
Thanks for spotting it! I had aliased ‘wget’ to ‘curl -O’ in my .bash_profile. I updated the tutorial to use the proper command.
Worked like a charm on Snow Leopard! Thank you!!
thanks very much for the openssl parameter, was supposed install gnutls libraries separately and found your post, thanks again.
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!
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.
Thanks a ton for the quick guide. Brand new to OSX, and didn’t realize that OpenSSL was the default SSL Package!
Thanks Tom! Worked perfectly.
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?
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.
In Xcode 4.3 there is an option to download and install command line tools in the Preference panel.
Lauch XCode, go to Préférences then Downloads.
Clic install on “Command line tools”.
That’s all.
Thanks for this. It was exactly what I needed, when I needed it.
helped! Thanks
Thx for this…. “./configure –with-ssl=openssl”. I was pretty bummed about the prospect of having to use wget w/o SSL.
The current version of Xcode no longer includes the command-line compilers and tools. These are a separate package that must be installed.
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.
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.
Hi, I’m followed your instruction and working now.
Yes, I’m install fink/port on Mac OSX Mountain Lion 10.8.
So, also install http://xquartz.macosforge.org
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.
echo ‘alias wget=”curl -O”‘ >> ~/.bash_profile
log out and log back in.
Boom.
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.
Thanks! Worked brilliantly!
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…..
Nice catch… WordPress keeps breaking line breaks in old posts, and I have no idea why.
Thank you Thomas! Worked like a charm on Lion.
Thanks man! worked great.
Thanks for your post – worked first time!
Thanks so much for your post – it was a huge time saver to have stumbled across your solution!
Worked like a charm on my MacBook Air with Lion 10.7.4. Thanks very much.
Thanks for the tips. It worked with openssl :)
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.
Thanks! Works great!
Thanks for the tutorial – this was a great help!
WTF!
“Launch of “tar” failed: the PowerPC architecture is no longer supported.”
Looks like it is time for a computer upgrade…
Thanks a lot for the detailed instructions, working great on Lion (10.7.4).
Worked great, thank you! -brewster
Thanks Thomas, I’m new to this kind of terminal action and it really helped me.
A flawless installation on Mountain Lion here.
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
Thank you! I’m so glad u posted this! It worked well on Snow Leopard and saved me lots of time.
Thanks for the tip about Mac OS X Lion’s Xcode’s Command Line Tools feature!
Worked like a charm on Mountain Lion. Thanks!
Flawless! Thank you so much.
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
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.
You don’t need XCode to get the Command Line Utils btw, they are available as a separate download on developer.apple.com
That’s awesome! Thank you Thomas!
Thanks! Worked like a charm. I’ve downloaded the command line tools without the xcode big package.
The alternative is amazing as long as one doesn’t need Xcode.
Works like a charm with OSX 10.6.8 Snow Leopard.
Thanks Thomas!
nice!!! very good!!! tanks
\o\|o|/o/
Awesome tut, thanks!
Never thought about using openssl. Thanks for sharing the solution!
Great information. I was able to successfully install wget. Thanks!
-Mike
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!
Thanks so much for these instructions. I’m an absolute n00b when it comes to working in the Terminal and your instructions were foolproof.
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/
Sweet. Thanks. It’s a pretty key program on Linux and I was starting to miss it on my Mac.
ty