Install wget in Mac OS X Without Homebrew or MacPorts

May 22, 2012 - 55 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! 😀

  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”

  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.

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