How to install wget in macOS? [closed]
Asked Answered
U

5

289

I try to install wget in MAC OS 10.11.1 but when I run ./configure --with-ssl=openssl I get this error:

configure: error: --with-ssl=openssl was given, but SSL is not available.

How to resolve this problem in OSX 10.11.1?

Unbalance answered 24/11, 2015 at 6:33 Comment(1)
Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See What topics can I ask about here in the Help Center. Perhaps Super User or Apple Stack Exchange would be a better place to ask. Also see Where do I post questions about Dev Ops?.Cupel
L
671

Using brew

First install brew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

And then install wget with brew:

brew install wget

Using MacPorts

First, download and run MacPorts installer (.pkg)

And then install wget:

sudo port install wget
Lakeesha answered 24/11, 2015 at 19:20 Comment(11)
I only had to run brew install wget --with-libressl and it worked flawlessly. ThanksOrnithic
Got this when installing? Warning: wget: this formula has no --with-libressl option so it will be ignored!Pammie
Or simply use: brew install wget . Homebrew will install any necessary dependenciesFortify
Honestly, this is the most painless answer. Use brew! In brew we trust!Twombly
Ehhhh what about those of us who don't use Brew and instead use MacPorts or something?Chartreuse
Oh wow, Macports is very easy installation as well. I've edited it in. Just do sudo port install wget.Chartreuse
Error: invalid option: --with-libresslNarwhal
I'm on macOS Big Sur version 11.4 and brew install wget worked perfectly. Great question. Perfect answer. Thanks a tonPied
macOS Monterey v12.5 Only sudo port install wget worked for me.Starstudded
homebrew should now be installed with /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" via brew.shMatheson
'brew install wget' isn't working in Ventura 13.1Skysail
A
13

For macOS Sierra, to build wget 1.18 from source with Xcode 8.2.

  1. Install Xcode

  2. Build OpenSSL

    Since Xcode doesn't come with OpenSSL lib, you need build by yourself. I found this: https://github.com/sqlcipher/openssl-xcode, follow instruction and build OpenSSL lib. Then, prepare your OpenSSL directory with "include" and "lib/libcrypto.a", "lib/libssl.a" in it.

    Let's say it is: "/Users/xxx/openssl-xcode/openssl", so there should be "/Users/xxx/openssl-xcode/openssl/include" for OpenSSL include and "/Users/xxx/openssl-xcode/openssl/lib" for "libcrypto.a" and "libssl.a".

  3. Build wget

    Go to wget directory, configure:

    ./configure --with-ssl=openssl --with-libssl-prefix=/Users/xxx/openssl-xcode/openssl
    

    wget should configure and found OpenSSL, then make:

    make
    

    wget made out. Install wget:

    make install
    

    Or just copy wget to where you want.

  4. Configure cert

    You may find wget cannot verify any https connection, because there is no CA certs for the OpenSSL you built. You need to run:

    New way:

    If you machine doesn't have "/usr/local/ssl/" dir, first make it.

    ln -s /etc/ssl/cert.pem /usr/local/ssl/cert.pem
    

    Old way:

    security find-certificate -a -p /Library/Keychains/System.keychain > cert.pem
    security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> cert.pem
    

    Then put cert.pem to: "/usr/local/ssl/cert.pem"

    DONE: It should be all right now.

Assignee answered 8/4, 2017 at 6:56 Comment(2)
I mean... this works, but it's a lot tougher than just using homebrewCrockery
@Crockery for someone who doesn't want to use homebrewAssignee
D
6

You need to do

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

Instead of this

./configure --with-ssl=openssl

Dismuke answered 16/2, 2017 at 5:2 Comment(0)
D
-2

I update mac to Sierra , 10.12.3

My wget stop working.

When I tried to install by typing

brew install wget --with-libressl

I got the following warning

Warning: wget-1.19.1 already installed, it's just not linked.

Then tried to unsintall by typing

brew uninstall wget --with-libressl

Then I reinstalled by typing

brew install wget --with-libressl

Finally I got it worked.Thank God!

Danley answered 4/4, 2017 at 16:43 Comment(0)
O
-10
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And then install wget with brew and also enable openressl for TLS support

brew install wget --with-libressl

It worked perfectly for me.

Obtest answered 15/6, 2017 at 7:11 Comment(3)
This is exactly the same as the accepted answer and is older, yet has got a vote of -1 whilst the accepted answer has a vote of 122. Why?Disingenuous
@Disingenuous this answer was submitted 15-Jun-2017, while the accepted answer was submitted 24-Nov-2015. I guess this answer is getting downvoted because it's a shameless copy of the accepted answerOffshore
Oops, sorry, I read "Jun 15" as "June 2015"! Don't know where I thought the day had gone. :">Disingenuous

© 2022 - 2024 — McMap. All rights reserved.