Install wget in Mac OS X Without Homebrew or MacPorts

May 22, 2012 - 89 Comments

Install wget in Mac OS X

Want to have wget on Mac without Homebrew or MacPorts for whatever reason? You can do that by building wget from source at the command line.

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 Mac 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. Honestly, using Homebrew is much easier and is probably better for most users, but admittedly it’s not for everyone.

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 Mac 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 http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz

You can check always check for the latest wget version through at ftp.gnu.org/gnu/wget/ here.

Using curl to download the latest wget source for El Capitan, Yosemite, etc:
curl -O http://ftp.gnu.org/gnu/wget/wget-1.16.3.tar.xz

Or to use an older version (prior versions of Mac OS X, including Mavericks, Mountain Lion, etc)
curl -O http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz

(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 MacOS Mojave, High Sierra, 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 http://ftp.gnu.org/gnu/wget/ 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 Mac OS X 10.10+ , Mac OS X 10.11+, macOS Sierra, Mojave, and later, use this variation of configure (from Martin in the comments):

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

Build the source:
make

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 Mac OS X El Capitan and Yosemite as well.

For most Mac users, they’ll likely want to simply install Homebrew first and then get wget, simply because Homebrew makes command line package management incredibly easy and there’s no manual building and compiling of source code necessary.

.

Related articles:

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

89 Comments

» Comments RSS Feed

  1. Tim says:

    You’ll probably want to update your commands to reflect the latest version of wget. The tar command and cd commands.

  2. H.Vrsalovic says:

    On Sierra (10.12.3), the following has been shown to work on a clean install of the OS:

    1. download openssl 0.9.8zg ( i won’t repeat the link; it’s been cited already). Note: the 0.9.8 zh package from various sources seems to be missing stuff, like the needed “include” directory. So don’t use that, even though openssl version commands on this OS indicate “zh” as the variant.

    2. unpack the openssl bundle into a tree somewhere…i used /usr/local/openssl-0.9.8zg , though that might not be strictly kosher because it’s not an installed thing at that point

    3. back where you unpacked wget, run the following, substituting the correct location of where you unpacked in step (2)

    OPENSSL_LIBS=”-L/usr/lib -lssl -lcrypto -lz” OPENSSL_CFLAGS=”-I/usr/local/openssl-0.9.8zg/include -I/usr/local/openssl-0.9.8zg/include/openssl” ./configure –with-ssl=openssl

    **MIND THE DOUBLE QUOTES!!** Many copy-pastes, especially on Mac OSX will mangle them to “fancy quotes” or otherwise

    configure should now complete successfully

    • H.Vrsalovic says:

      addendum:

      the reason for this approach is because the OS has the ‘binary install’ of openssl (in the standard /usr/lib directory) but doesn’t have sources (namely, the headers), at least not that I could find nor detectable by pkg-config. So the sources have to be downloaded separately and ‘config’ must be told explicitly where they are , via the OPENSSL_CFLAGS var.
      The OPENSSL_LIBS var is necessary because using pkg-config (which is triggered when you use the –with-xxxxx flag to ‘config’) is kind of all-or-nothing; so even though the /usr/lib is the standard place that would be found by pkg-config, it needs to be made explicit because pkg-config won’t run for openssl here
      (* I oversimplified that somewhat for sake of clarity)

      Also as a warning: I’ve read guides that advocate copying the sources of openssl (downloaded and unpacked in my step (2) above) into system directories like /usr/include …or slightly less evil, symlinking. Don’t do this. If the OS ever upgrades openssl, it will have no way of knowing your headers are now “stale” and you could run into mystery compile errors down the line that may be very hard to track down

      Perhaps even more dangerous is actually *building* and *installing* the openssl you downloaded… Really don’t do this!
      You will essentially “upgrade” openssl in the system in a very transparent-to-the-OS way and while it probably will be Ok, it’s impossible to tell what the sideeffects to the OS and/or preexisting apps/binaries will be

  3. Anon says:

    I wish I had just scrolled to the bottom and installed brew first. All of these instructions will lead to headaches if you’re on 10.12. I just wanted to install wget, I didn’t want to waste my whole Saturday afternoon.

  4. Howard A. Landman says:

    These instructions do not work for wget 1.17 on Mac OS 10.11.6.

    “./configure –with-ssl=openssl” completes without errors, but then “make” fails with “openssl.c:39:10: fatal error: ‘openssl/ssl.h’ file not found”

    Setting the various flags suggested above does not change this. I assume that Apple has removed files now that openssl is deprecated. Probably the right thing to do would be to use Apple’s internal SSL rather than openssl.

  5. CBA says:

    Gotta say… I followed a million different leads on this comment page to no avail and then installed wget in a total of 5 seconds by installing brew (which also took 5 seconds). Just in case you’re looking for a hands-off approach to getting wget on your mac.

  6. Raul GD says:

    Just to update this a bit, for Mac OS X El Capitan and newer, SSL location switched, this is what worked for me:

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

    make

    sudo make install

    Hope this helps anyone.

  7. Robert Strachan says:

    Ok, after trial and error, using a mix of gui and Terminal, I was able to figure this all out.

    OS: Mac OS X 10.11.5 El Capitan
    Xcode 7.3.1 with commandline tools installed

    I downloaded openssl 1.0.2 via GitHub Desktop but you can use this: https://www.openssl.org/source/openssl-1.0.2h.tar.gz

    unzipped by doubleclicking on the archive

    In Terminal, (i use iTerm) I cd into the newly created openssl directory.

    enter these commands:

    ./configure darwin64-x86_64-cc (for 64bit machines)
    make
    sudo make install

    Once that’s done cd into the wget source directory (i used wget 1.18)

    Enter these commands into iTerm/Terminal:

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

    And you’re done.

    I could have compiled each set of instructions into one line each but that would kill readability.

    Based on research, El Capitan doesn’t use openssl as the default cryptology library any more so they don’t include the files needed to compile wget or many other Unix apps & tools.

    I now have current versions of both openssl and wget with the ability to compile other apps without undue stress.

  8. 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

    Nev

    • Nev says:

      Discovered in /usr/local/openssl-0.9.8zg/PROBLEMS an issue with OpenSSL:

      “The workaround may be to change the following lines in apps/Makefile and
      test/Makefile:

      LIBCRYPTO=-L.. -lcrypto
      LIBSSL=-L.. -lssl

      to:

      LIBCRYPTO=../libcrypto.a
      LIBSSL=../libssl.a

      It’s possible that something similar is needed for shared library support
      as well. That hasn’t been well tested yet.”

      So I added the .a the the defn of OPENSSL_LIBS as follows:

      OPENSSL_LIBS=”-L/usr/lib -lssl.a -lcrypto.a -lz”

      then ./configure –with-ssl=openssl runs to completion:

      config.status: creating Makefile
      config.status: creating src/Makefile
      config.status: creating doc/Makefile
      config.status: creating util/Makefile
      config.status: creating po/Makefile.in
      config.status: creating tests/Makefile
      config.status: creating lib/Makefile
      config.status: creating testenv/Makefile
      config.status: creating src/config.h
      config.status: executing depfiles commands
      config.status: executing po-directories commands
      config.status: creating po/POTFILES
      config.status: creating po/Makefile
      configure: Summary of build options:

      Version: 1.17
      Host OS: darwin15.4.0
      Install prefix: /usr/local
      Compiler: gcc
      CFlags: -I/usr/include -DHAVE_LIBSSL -DNDEBUG
      LDFlags:
      Libs: -L/usr/lib -lssl.a -lcrypto.a -lz -lz
      SSL: openssl
      Zlib: yes
      PSL: no
      Digest: yes
      NTLM: yes
      OPIE: yes
      Debugging: yes
      Assertions: no
      Valgrind: Valgrind testing not enabled
      Metalink: no
      GPGME: no

      but make fails:

      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 -MT openssl.o -MD -MP -MF .deps/openssl.Tpo -c -o openssl.o openssl.c
      openssl.c:39:10: fatal error: ‘openssl/ssl.h’ file not found
      #include
      ^
      1 error generated.
      make[3]: *** [openssl.o] Error 1
      make[2]: *** [all] Error 2
      make[1]: *** [all-recursive] Error 1
      make: *** [all] Error 2

      What now? Where should the missing file ‘openssl/ssl.h’ be? How do I get it there?

      Have I correctly “symlinked the needed directories” from bliemli’s steps? This is what I used (note I used wget-1.17 not wget-1.17.1):

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

  9. 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

  10. Gustavo says:

    Guys, please help.

    I followed this sequence:

    cd /usr/local

    curl -O https://opensource.apple.com/source/OpenSSL098/OpenSSL098-52.40.1/openssl-0.9.8zg.tar.gz

    tar -xzf openssl-0.9.8zg.tar.gz

    curl -O http://ftp.gnu.org/gnu/wget/wget-1.17.1.tar.gz

    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

    make

    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

  11. 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 http://ftp.gnu.org/gnu/wget/wget-1.17.1.tar.xz

  12. oliver says:

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

  13. bliemli says:

    Hi,

    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”

  14. 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”
    OPENSSL_CFLAGS=”-I/usr/include”
    ./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 https://opensource.apple.com/source/OpenSSL098/OpenSSL098-52.40.1/openssl-0.9.8zg.tar.gz

    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
    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

    Wgetrc:
    /usr/local/etc/wgetrc (system)
    Compile:
    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
    Link:
    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:

      Hi,

      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 ?

      Regards

    • 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/`

      then
      `make clean`
      if you tried to run make

      Cheers!!!

  15. jason says:

    easy way

    # install brew
    ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

    # install wgewt (with openssl dependency)
    brew install wget

    done

    • justin says:

      this by far is the best solution hands down.. this saved me tons of headache. thanks jason

      for anyone else running into this issue, I’m running OS X El Capitan, version 10.11.6 and this fixed it for me … very simple

    • Aaron says:

      Just popped by to say this still worked for me running 10.13.5.

      Thanks for this! :)

  16. Garth DAttilo says:

    In a pinch, the binary available here “appears” to work with 10.11:
    https://trick77.com/wp-content/uploads/2008/01/wget-1.9.1_mac_os_x.zip

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

  17. 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.

  18. Prairiewalker says:

    Thanks. Quick and easy on 10.10.3.

  19. 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

      –with-libssl-prefix=/usr

      instead.

    • 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”

      • Martin says:

        okay the system changes all two dashes to a single one… look up in the article how it ./configure should look like….

      • elle says:

        I still keep getting the error even when I try the ssl/libssl stuff….using 1.16.3 and yosemite OS X

      • Mike says:

        Thanks Martin! Your ./configure options worked to resolve my GNUTLS and OPENSSL issues.

        wget version 1.16.3; OS X Yosemite 10.10.5

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

  20. Rick says:

    Your instructions for getting wget worked perfectly for me until I got to the step:
    Build the source:
    make
    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…

  21. lan3jur says:

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

  22. Ozgur Uksal says:

    nice article. Thanks

  23. Michele says:

    Thank you soooooo much!!

  24. Thomas says:

    Exactly what I needed, thanks!

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

  26. 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 :-)

  27. Ravinder Matte says:

    Nice and clean. Very helpful.

  28. 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

  29. JR Fent says:

    THANK YOU! Great instructions!

  30. ashorlivs says:

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

  31. 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/Xcode.app/Contents/Developer

    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.

  32. Alex says:

    Awesome ! Many thanks

  33. Kathy says:

    Thank you! This worked great.

  34. DewaKoding says:

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

  35. Sergio says:

    Bravo! Worked like a charm, thank you :)

  36. momer says:

    Thank you, that worked!

  37. kraz says:

    Thanks a lot!
    This helped me….

  38. Simon says:

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

  39. Justus Beyer says:

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

    Thanks a lot!

    Justus

  40. 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.

  41. Massimiliano says:

    Thanks it worked like a charm

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

  43. 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!

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

  45. 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 :)

  46. 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

  47. cf says:

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

  48. cf says:

    Assuming you have already installed xcode tools:

    curl http://ftp.gnu.org/gnu/wget/wget-1.14.tar.xz > 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

    done!

  49. Randy says:

    Thanks – this was helpful!

  50. Noogrub says:

    Thanks for the help!

  51. Drew says:

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

  52. prabin says:

    thanks alot for usefull info

  53. 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.

  54. 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 .configure.sh from /usr/local to /opt/local which isn’t used that much and keeps the individual manual installations away from the automated ones.

  55. 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.

  56. 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…

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

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

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

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site