Ubuntu+OpenSSL安装+not found (required by openssl)

作者: TAIS3 分类: 杂七杂八 发布时间: 2021-11-24 15:29

下载地址:https://www.openssl.org/source/openssl-1.1.1a.tar.gz

下载后解压,解压目录这里是~/software/

 tar -zxvf openssl-1.1.1a.tar.gz -C ~/software/

进入解压目录下软件的根目录:

cd ~/software/openssl-1.1.1a/
sudo ./config
sudo make && sudo make install

编译安装完成后,查看版本:

openssl version

报错提示:

openssl: error while loading shared libraries: 
libssl.so.1.1: cannot open shared object file: No such file or directory

或者:

> openssl version
> openssl: /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by openssl)
> openssl: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by openssl)

解决方法:

echo "export LD_LIBRARY_PATH=/usr/local/lib" >> ~/.bashrc
export LD_LIBRARY_PATH=/usr/local/lib

然后查看设置好的环境变量:

echo $LD_LIBRARY_PATH

没问题应该是这个/usr/local/lib

然后查看版本:

feng@FZ:~/software/openssl-1.1.1a$ openssl version
OpenSSL 1.1.1a  20 Nov 2018

完成!

参考

需翻墙
OPENSSL_1_1_1′ not found报错参考:https://github.com/openssl/openssl/issues/5845

发表评论