ubantu libssl.so.1.1: cannot open shared object file

libssl.so.1.1: cannot open shared object file

使用 Ubuntu 22.04 时,有时候会遇到如下错误

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

这是因为Ubuntu 22.04 默认使用的是 openssl3.0 ,但是大多为 Ubuntu 生成的可执行文件依赖 openssl 1.1

安装Openssl 1.1

我们可以采取源码安装的方式解决这个问题

下载源码包并解压

首先确定已经安装下载工具

apt install -y wget

随后执行下载操作

wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz

对下载的文件解压并进入到文件夹中

tar xvf openssl-1.1.1q.tar.gz && cd openssl-1.1.1q

安装 GCC、Perl、Make

首先确保 Ubuntu 22.04 已经安装 GCC Perl Make工具

如果你不知道这几样是什么,那么请执行安装命令

sudo apt install -y perl gcc make

执行 config 配置

在成功安装上述工具后执行 config命令

./config

编译

随后执行 make

make

安装

这时 openssl1.1 就已经编译好了,我们还需要将动态库放入 /usr/local/lib中,执行 make install 即可

sudo make install

设置环境变量并生效

有些可执行文件读取的动态链接库的路径不同,这里最好设置一下动态链接库的环境变量

sudo echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib" >> /etc/profile

执行 source /etc/profile 使其在当前客户端生效

source /etc/profile

相关推荐
IvorySQL13 小时前
PostgreSQL 大对象管理指南:pg_largeobject 从原理到实践
postgresql
boonya1 天前
国内外常用的免费BUG管理工具选型
bug
10岁的博客1 天前
Bug排查日记:高效记录与解决之道
bug
彭刷子2 天前
【Bug】Nexus无法正常启动的五种解决方法
bug·nexus
Java水解2 天前
PostgreSQL向量库pgvector实战指南
后端·postgresql
黑客飓风2 天前
从基础功能到自主决策, Agent 开发进阶路怎么走?
面试·log4j·bug
mahuifa2 天前
C++(Qt)软件调试---bug排查记录(36)
c++·bug·软件调试
Kyln.Wu2 天前
【python实用小脚本-205】[HR揭秘]手工党逐行查Bug的终结者|Python版代码质量“CT机”加速器(建议收藏)
开发语言·python·bug
2501_930104042 天前
Bug 排查日记:打造高效问题定位与解决的技术秘籍
bug
weixin_377634842 天前
【YOLO】数据增强bug
yolo·bug