Install wget in Mac OS X Without Homebrew or MacPorts

May 22, 2012 - 72 Comments

Install wget in Mac OS X

The command line tool wget lets you retrieve a group of files from FTP and HTTP protocols, it’s a very useful utility for web developers and powerusers to have around because it lets you do things like perform quick and dirty site backups and even mirror websites locally.

This approach is going to build and install wget in OS X from source, this means you’ll need Xcode (App Store link), or at least and the Unix command line dev tools installed on the Mac, but it has the benefit of eliminating the need of a package manager like Homebrew or MacPorts.

For those who don’t have the Command Line Tools package either with or without Xcode installed yet, it’s fairly simple: Open Terminal and type ‘xcode-select –install’, or you can do it from Xcode by opening XCode, then go “Preferences” and to the downloads section, and choose “Install Command Line Tools”, or you can get it from the Apple Developer Site as described here. Because the package has to download from Apple, it may take a while depending on your internet connection. Command Line Tools installs a C compiler, GCC, and many other helpful utilities that are commonly used in the unix world.

How to Install wget in OS X

Moving ahead and assuming you have Xcode and the command line tools installed, launch Terminal and enter the following commands as shown.

First, use curl to download the latest wget source:
curl -O

Or to use an older version (prior versions of OS X)
curl -O

(sidenote: a new version of wget may be available, version 1.16.3 (wget-1.16.3.tar.gz) has been confirmed to work in OS X El Capitan and OS X Yosemite, 1.15 is confirmed compatible with OS X Mavericks, while 1.13.4 has been confirmed compatible with OS X Mountain Lion. You can pick whichever one you want from the directory if you want a different version)

Next we use tar to uncompress the files you just downloaded:
tar -xzf wget-1.15.tar.gz

Use cd to change to the directory:
cd wget-1.15

Configure with the appropriate –with-ssl flag to prevent a “GNUTLS not available” error:
./configure --with-ssl=openssl

Note if you still have an error in OS X 10.10+ and OS X 10.11+, use this variation of configure (from Martin in the comments):

./configure --with-ssl=openssl --with-libssl-prefix=/usr/local/ssl

Build the source:

Install wget, it ends up in /usr/local/bin/:
sudo make install

Confirm everything worked by running wget:
wget --help

Clean up by removing wget source files when finished:
cd .. && rm -rf wget*

You’re all set, enjoy wget in Mac OS X.

The latest version of wget should configure, make, and install fine in OS X El Capitan and Yosemite as well.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Command Line, Mac OS X, Tips & Tricks


» Comments RSS Feed

  1. NiX says:

    I don’t think you’d need Xcode for that, Command Line Tools for Xcode would do the job.

    Btw, why’d you need wget? Won’t curl suffice?

  2. curl ftw says:

    Why not just use curl? It does the same duties, in fact you use it in the article walkthrough for downloading the original source, heh…

  3. Floris says:

    On a fresh installation of OSX Lion I get
    configure: error: no acceptable C compiler found in $PATH

    • Onerti says:

      You need to install Xcode and Unix Dev Tools, you can’t compile code from source without gcc installed.

  4. James says:

    I used to do the whole download, tar zxvf, configure, make, make install process and it’s simply not worth it. Not when it’s easier to copy and paste the Homebrew installation script to the Terminal once and then simply issue “brew install wget” and suddenly, you have wget installed and working. You are bound to find other items missing from OS X that can be installed with Homebrew.

    Plus you can easily update what you’ve installed with brew when new releases or security issues are fixed. The only downside to Homebrew is that it doesn’t seem to work well with multiple local user accounts. The /usr/local folders get owned by one user. So if you do switch user accounts you’ll need to “su – admin” where admin is the account you installed brew with. Regular users can run the programs installed by brew but they can’t install other brew recipes nor update brew itself. Some users have assigned an admin group to /usr/local so any administrator level user can work with brew commands.

    Homebrew is an easier to use system than Macports and both are package managers. Redhat and Debian pretty much invented the concept of package management where users could pull packages from a repository and the installation would be heavily automated. Windows Update didn’t exist at the time and I think only Netware had something even remotely close. Nowadays you can setup a virtual farm of developer workstations and automate the entire process of generating new virtual machines and configuring their software via puppet scripts and yes driving brew commands via puppet as well. This ensures all the workstations are consistent in their configurations and software versions, etc. Doing things by hand is tedious and error prone.

    So if you are one guy with one computer that you own and manage yourself, sure, go right ahead and manually download, configure, compile, and install each and every single Unix/Linux application. I remember having to do this to install Netscape or the Gimp. Examining ./configure –help to ensure I was passing the right parameters and options, etc. Struggling with dependencies between applications using different versions of the same libraries. Creating symbolic links from newer library versions to an older library version required by a single application. It’s just plain painful, especially if you have to do that to 300+ computers on a regular basis. So if it’s good enough for the SysAdmins it’s good enough for anyone! After all, SysAdmins are lazy and didn’t we buy Mac’s to make things easier? Wasn’t that the point? Otherwise, I might as well be running a Slackware Linux distro from 1992!

    Do yourselves a favor and use a package manager such as Macports or Homebrew and avoid manually downloading, compiling and installing software. But if for some reason you have to do it, change the default path via the from /usr/local to /opt/local which isn’t used that much and keeps the individual manual installations away from the automated ones.

  5. NiX says:

    Hey you all! Stop installing Xcode if you don’t need a full and pro IDE!

    Simply install Command Line Tools for Xcode, it’s packed with gcc and some Apple’s header files. It is simple, easy, AND official. It delivers what you want only: gcc.

  6. prabin says:

    thanks alot for usefull info

  7. Drew says:

    Haha, my first build :)
    Extremely easy, worked great. Thanks!

  8. Noogrub says:

    Thanks for the help!

  9. Randy says:

    Thanks – this was helpful!

  10. cf says:

    Assuming you have already installed xcode tools:

    curl > wget-1.14.tar.xz &&
    tar xpJf wget-1.14.tar.xz &&
    cd wget-1.14 &&
    ./configure –prefix=/usr/local && make -j8 && sudo make install


  11. cf says:

    werps! need –with-ssl=openssl too :)

  12. Robyn says:

    OK, so I got hung up with the ‘no acceptable C compiler found in $PATH’ error too. Turns out with Lion (or Mountain Lion in my case) you have to do it a little differently.

    1. Install Xcode
    2. Launch Xcode, authorize it and so on
    3. Go to preferences> downloads and install command line tools

    after that you should be able to follow the commands listed here without issue… but check for the latest version since the one in the original post is a little out of date

  13. Patrick says:

    Can’t get any simpler than that.

    Most ‘how tos’ are overly complex and over bloated. This was perfect. 2 minutes to install wget, thanks :)

  14. Joe Doe says:

    Thanks a lot, that was quick. Kind of dumb question but… how to uninstall?
    Just run
    $sudo rm /usr/local/bin/wget
    And wget is gone forever and ever? Or is it anything else that needs removal?

  15. Gene says:

    This worked great for me. I wasted so much time trying to install wget before I found your instructions, but nothing else seemed to work. Thanks so much!

  16. I just don’t want to install Homebrew or Macports just to have wget. Thanks for this guide.

  17. Massimiliano says:

    Thanks it worked like a charm

  18. Singham says:

    everything was fine until i typed “wget –help”, the return message was, “-bash: wget: command not found”. Any idea what i could be doing wrong guys? I installed x-code, macports, and command line tools already.

  19. Justus Beyer says:

    Worked perfectly on Mountain Lion. The more recent wget version 1.14 didn’t compile though.

    Thanks a lot!


  20. Simon says:

    Thank you sir. Had to install Xcode but was going to anyway.

  21. kraz says:

    Thanks a lot!
    This helped me….

  22. momer says:

    Thank you, that worked!

  23. Sergio says:

    Bravo! Worked like a charm, thank you :)

  24. DewaKoding says:

    I’ve tried on my Mac Mavericks and Works like a charm! Thank you for posting.

  25. Kathy says:

    Thank you! This worked great.

  26. Alex says:

    Awesome ! Many thanks

  27. Martin says:

    Great guide!

    Successfully compiled the latest wget v.1.15, ML 10.8.5, Xcode 5.0.2, command_line_tools_October_2013, but needed to do a quick tweak (previously had Xcode 4.x):

    sudo xcode-select -switch /Applications/

    To solve “can’t build binary” error ” see … config.log for more details” on first step: ./configure –with-ssl=openssl

    Thank you!

    • Joe McCarthy says:

      FWIW, I have Xcode 5.1.1 (& command line tools) installed and was able to successfully install wget 1.5 on OS X 10.8.5 without having to make any changes in the original instructions above.

  28. ashorlivs says:

    Thank you for this tips, works great under X.8.5 :)

  29. JR Fent says:

    THANK YOU! Great instructions!

  30. Joshua Copeland says:

    Super helpful, thanks for this. I was looking for a way to do wget in terminal and first thing you show is curl -O which did the trick but followed ur instructions anyway , now I got wget! :D

  31. Ravinder Matte says:

    Nice and clean. Very helpful.

  32. Rasmus says:

    Very good and easy to use instructions!
    I can confirm that this is working on OS X Yosemite with wget version 1.16 :-)

  33. Sisko says:

    How do you update this to version 1.16 now that its installed as 1.15? Follow the same steps but under the 1.16 download?

  34. Thomas says:

    Exactly what I needed, thanks!

  35. Michele says:

    Thank you soooooo much!!

  36. Ozgur Uksal says:

    nice article. Thanks

  37. lan3jur says:

    This is probably a stupid question, but how do I uninstall wget ‘completely’ if I installed it this way?

  38. Rick says:

    Your instructions for getting wget worked perfectly for me until I got to the step:
    Build the source:
    At that point, after entering “make” and pressing enter, I got the following:
    -bash: make: command not found
    Please advise, thanks!

    • coffeeeeee says:

      You need to install Xcode or the command line tools, make is a compiler

      Why do you need wget if you aren’t familiar with the command line? There are GUI FTP apps like FileZilla, CyberDuck, etc

      • Rick says:

        I’ve used unix on occasion since 1882, uh, I mean 1982. Though I have not bothered to commit all 1,782 unix commands to memory; hence my unfamiliarity with make. I hear that memorizing unix commands and their synatax is a known, sure, drug-free cure for insomnia… I have no difficulty sleeeeping…

  39. Martin says:

    I’ve got an error configuring wget 1.6.3 on Yosemite 10.10.3:

    “checking for OPENSSL… no
    configure: error: in `/Users/end/Downloads/Sources/wget-1.16.3′:
    configure: error: The pkg-config script could not be found or is too old. Make sure it
    is in your PATH or set the PKG_CONFIG environment variable to the full
    path to pkg-config.

    Alternatively, you may set the environment variables OPENSSL_CFLAGS
    and OPENSSL_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.”

    But adding this libssl path worked fine:

    ./configure –with-ssl=openssl –with-libssl-prefix=/usr/local/ssl

    Thanks for putting this how to togather.

    • armando says:

      Thanks for the tip!

      You had a custom installation of libssl? Using the os x (10.9.5) shipped libssl library under /usr/lib worked fine, i.e. used



    • Martin says:

      I just downgraded to Mavericks and had to do compile it again.

      Copy and paste my previous example did not work because the ./configure options needs to start with two dashes “–with…” instead of one “-with…”
      I don’t know if the OSXDaily comments get changed during the publishing….
      It should look like this ( without quotes ):
      “./configure –with-ssl=openssl –with-libssl-prefix=/usr/local/ssl”

    • Jonathan says:

      I can’t get this to work with any of the commands given, im on 10.11 and i keep getting configure: error: –with-ssl=openssl was given, but SSL is not available.

    • Greg says:

      I also got the error when trying to configure wget 1.6.3 on El Capitan 10.11.

  40. Prairiewalker says:

    Thanks. Quick and easy on 10.10.3.

  41. Melih says:

    Hi Everyone,

    Not going to say I am too familiar with the details, but certainly have enough technical knowledge.

    I ran into the following error at the ./configure part.

    configure: error: The pkg-config script could not be found or is too old. Make sure it
    is in your PATH or set the PKG_CONFIG environment variable to the full
    path to pkg-config.

    Alternatively, you may set the environment variables OPENSSL_CFLAGS
    and OPENSSL_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.

    To get pkg-config, see .
    See `config.log’ for more details

    Before I start messing with any further details, thought it would be good to get some help.

    Much appreciated.

  42. Garth DAttilo says:

    In a pinch, the binary available here “appears” to work with 10.11:

    • Boyce says:

      Hi Garth, thank you for your suggestion. I would like to say this wget-1.9.1 also works for me with my El Capitan 10.11.3.

      I have just wget to my company site for downloading something and it just works, while I am also suffering from above problem.

  43. jason says:

    easy way

    # install brew
    ruby -e “$(curl -fsSL”

    # install wgewt (with openssl dependency)
    brew install wget


  44. bliemli says:

    I was able to successfully compile wget 1.16.3 on 10.11. You need to tell wget to use openssl via parameter –with-ssl=openssl and set the OPENSSL_LIBS and OPENSSL_CFLAGS environment variables, or the script will complain about not being able to find pkg-config. I found the appropriate values for the env vars in /usr/lib/pkgconfig/libssl.pc. Setting the parameter –with-libssl-prefix=/usr didn’t work, it couldn’t find the libraries nonetheless.

    OPENSSL_LIBS=”-L/usr/lib -lssl -lcrypto -lz”
    ./configure –with-ssl=openssl

    After this successful ./configure, make fails with the following error:
    openssl.c:39:10: fatal error: ‘openssl/ssl.h’ file not found

    So it seems we need the OpenSSL source. I got the tar.gz from Apple’s opensource page, upacked it into /usr/local, symlinked the needed directories – and it worked!

    curl -O

    ln -s /usr/local/openssl-0.9.8zg/include/openssl/ /usr/local/wget-1.16.3/
    ln -s /usr/local/openssl-0.9.8zg/crypto/ /usr/local/wget-1.16.3/

    make install

    wget –version
    GNU Wget 1.16.3 built on darwin15.0.0.

    +digest +https +ipv6 -iri +large-file -nls +ntlm +opie -psl +ssl/openssl

    /usr/local/etc/wgetrc (system)
    gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC=”/usr/local/etc/wgetrc”
    -DLOCALEDIR=”/usr/local/share/locale” -I. -I../lib -I../lib
    -I/usr/include -DHAVE_LIBSSL -DNDEBUG
    gcc -I/usr/include -DHAVE_LIBSSL -DNDEBUG -liconv -L/usr/lib -lssl
    -lcrypto -lz -lz ftp-opie.o openssl.o http-ntlm.o ../lib/libgnu.a

    Copyright (C) 2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Originally written by Hrvoje Niksic .
    Please send bug reports and questions to .

    • bubu says:


      Thanks for your help.

      Could you please tell what command exactly we need to type in the terminal to set the OPENSSL_LIBS and OPENSSL_CFLAGS environment variables ?


    • Kiosko says:

      You are the best! Should definetly update this blog post and all the others on the internet about this.

      One small clarificaton, after downloading openssl one just needs to do
      `sudo cp -r openssl-0.9.8zg/include/openssl /usr/local/include/`

      `make clean`
      if you tried to run make


  45. bliemli says:


    Just write them as indicated, optionally with an “export” in front of each:

    export OPENSSL_LIBS=”-L/usr/lib -lssl -lcrypto -lz”
    export OPENSSL_CFLAGS=”-I/usr/include”

  46. oliver says:

    For me, it worked like this:
    ./configure –with-ssl=openssl –with-libssl-prefix=/opt/local

  47. Ben says:

    Works great and still useful after four years. Thanks for this post!

    By the way, as of February 2016, wget version 1.17.1 is the latest now. You can grab it with
    curl -O

  48. Gustavo says:

    Guys, please help.

    I followed this sequence:

    cd /usr/local

    curl -O

    tar -xzf openssl-0.9.8zg.tar.gz

    curl -O

    tar -xzf wget-1.17.1.tar.gz

    ln -s /usr/local/openssl-0.9.8zg/include/openssl/ /usr/local/wget-1.17.1/

    ln -s /usr/local/openssl-0.9.8zg/crypto/ /usr/local/wget-1.17.1/

    sudo cp -r openssl-0.9.8zg/include/openssl /usr/local/include/

    export OPENSSL_LIBS=-“L/usr/lib -lssl -lcrypto -lz”

    export OPENSSL_CFLAGS=“-I/usr/include”

    cd wget-1.17.1

    ./configure –with-ssl=openssl


    And I’m getting the following error:

    clang: error: no such file or directory: ‘“-I/usr/include”’

    Also, when I do:

    export OPENSSL_LIBS=-“L/usr/lib -lssl -lcrypto -lz”

    I get this error:

    -bash: export: `-lssl’: not a valid identifier
    -bash: export: `-lcrypto’: not a valid identifier
    -bash: export: `-lz”’: not a valid identifier

    I would really appreciate your help!!

    MAC OS X El Capitan 10.11.3

    Thank you!

    • Confusious says:

      You are getting syntax errors because you’re injecting random characters into your paths and syntax, who knows why you are doing that, I can’t answer that for you, but that is why you’re seeing “not a valid identifier” and “no such file or directory” – you have bungled the path and the syntax.

      Just configure it with SSL like so:

      ./configure –with-ssl=openssl –with-libssl-prefix=/opt/local

      then make, make install

  49. Jon Brooks says:

    Nope, he is getting syntax errors because the double-quotes included in the instructions further back in the thread were back-to-front:

    In the helpful email from Bliemli, there is an instruction to include the path to the openssl libraries/include files:

    export OPENSSL_LIBS=”-L/usr/lib -lssl -lcrypto -lz”
    export OPENSSL_CFLAGS=”-I/usr/include”

    Unfortunately, the way the double quotes are presented there, and how they copy across into the terminal means that the environment variables are not set correctly. Just copy the lines above and edit the quotes to use the one on your keyboard and all should be well….

    Cheers, Jon

  50. Nev says:

    Thanks bliemli but I’m still not there yet and not skilled enough to troubleshoot. I’ve followed much of Gustavo’s instructions with the OPENSSL_LIBS & OPENSSL_CFLAGS changes from Jon and I used wget-1.17. The ./configure fails for me, I tried all 3 variants listed here:

    ./configure –-with-ssl=openssl
    ./configure –with-ssl=openssl –with-libssl-prefix=/usr/local/ssl
    ./configure –with-ssl=openssl –with-libssl-prefix=/opt/local

    All fail as follows:
    checking for inet_ntoa… yes
    checking for socket in -lsocket… no
    checking for pkg-config… no
    checking for LIBPSL… no
    checking for library containing psl_builtin… no
    configure: WARNING: *** libpsl was not found. Fallback to builtin cookie checking.
    checking for ZLIB… no
    checking for compress in -lz… yes
    checking for dlopen in -ldl… yes
    checking for libssl… no
    configure: error: –with-ssl=openssl was given, but SSL is not available.

    I’m very rusty with linux skills, please help.

    MacOS El Capitan 10.11.4


Leave a Reply


Shop for Apple & Mac Deals on

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates