美文网首页
mac os openssl未找到/加载失败问题处理

mac os openssl未找到/加载失败问题处理

作者: 捞月亮的阿汤哥 | 来源:发表于2020-02-01 22:40 被阅读0次

问题描述:
使用一些命令的时候,比如wget命令的时候报错,先前安装的时候正常

wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/bin/wget
  Reason: image not found
[1]    34593 abort      wget

原因描述:
现在openssl库指向了1.1,但是你运行的命令依赖1.0的openssl造成报错。
这个库被非常多的包所依赖,往往由于brew install xxx导致openssl升级成1.1,而已安装的命令依赖openssl 1.0。
查看你当前使用的openssl很简单:

brew info openssl

比如我问题发生的时候,显示的如下

openssl@1.1: stable 1.1.1d (bottled) [keg-only]

解决方法很简单:
一般说来brew会保留旧版本的openssl

  • 列出你的openssl 1.0.x的版本
ls -al /usr/local/Cellar/openssl*

我的输出结果如下:

/usr/local/Cellar/openssl:
total 0
drwxr-xr-x   3 zihao  staff    96 12 13 23:27 .
drwxrwxr-x  69 zihao  admin  2208  1 31 12:34 ..
drwxr-xr-x  13 zihao  staff   416 12 13 23:27 1.0.2t

/usr/local/Cellar/openssl@1.1:
total 0
drwxr-xr-x   3 zihao  staff    96  1  3 13:19 .
drwxrwxr-x  69 zihao  admin  2208  1 31 12:34 ..
drwxr-xr-x  14 zihao  staff   448  1  3 13:19 1.1.1d
  • 第一步中你知道了你openssl 1.0的版本是1.0.2t
brew switch openssl 1.0.2t
  • 当然你也可以通过第二步切换成1.1.x版本

相关文章

网友评论

      本文标题:mac os openssl未找到/加载失败问题处理

      本文链接:https://www.haomeiwen.com/subject/sicfxhtx.html