OSX openssl版本与brew的openssl不同

时间:2014-06-02 14:21:26

标签: macos openssl homebrew

我刚在终端输入 openssl version ,我得到以下结果:

OpenSSL 0.9.8y 2013年2月5日

所以我运行了 brew update brew upgrade openssl

第一个返回将Homebrew从7afeb3af更新为8cabfe85。,第二个返回 openssl-1.0.1g已安装。 所以键入 brew链接--force openssl

按照上述步骤我输入 openssl version 我得到了相同的结果

OpenSSL 0.9.8y 2013年2月5日。

如何在mac osx 10.9.3上更新openssl?

2 个答案:

答案 0 :(得分:3)

所以这是正在发生的事情。你有两份OpenSSL。

  1. 版本0.9.8 - 位于/usr/bin/openssl,预安装在OS X上
  2. 版本1.0.1g - 位于/usr/local/Cellar/openssl/1.0.1h/bin/openssl,由brew安装。
  3. 当您运行brew upgrade openssl时,实际上您运行了brew install openssl,因为brew还没有在您的系统上安装openssl。 (请记住,brew不会控制计算机上的所有软件 - 只控制它安装的软件。)

    原来是brew install openssl的消息:

    ==> Caveats
    A CA file has been bootstrapped using certificates from the system
    keychain. To add additional certificates, place .pem files in
      /usr/local/etc/openssl/certs
    
    and run
      /usr/local/opt/openssl/bin/c_rehash
    
    This formula is keg-only, so it was not symlinked into /usr/local.
    
    Mac OS X already provides this software and installing another version in
    parallel can cause all kinds of trouble.
    
    The OpenSSL provided by OS X is too old for some software.
    
    Generally there are no consequences of this for you. If you build your
    own software and it requires this formula, you'll need to add to your
    build variables:
    
        LDFLAGS:  -L/usr/local/opt/openssl/lib
        CPPFLAGS: -I/usr/local/opt/openssl/include
    

    这实际上解释了OS X已预装。如果从默认的openssl更改,则使用不同的非系统openssl可能会导致问题。因此,brew并没有将它链接到您的/ usr / local,这可能是您路径的一部分。

    我认为你想升级你的openssl,因为你试图安装的某个软件包需要更新的版本。 Ahoy - 消息告诉您应该安装该软件包并将其指向新的闪亮的brew openssl。

答案 1 :(得分:2)

运行brew info openssl并按照其中的说明操作。不要尝试--force将最新的openssl链接到默认安装OSX的那个。 (0.9.8)

具体来说,它会要求你将openssl的Homebrew版本(截止日期应为1.0.2)添加到$ PATH中。
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

注意:确保从bash_profile中删除任何export PATH行,因为上面的这一行会导出它,以便将$ PATH变量的其余部分附加到结尾。要查看bash配置文件,请使用vi ~/.bash_profile

这样做可以解决安装包的问题(特别是需要编译的Ruby Gems)。

相关问题