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

相关推荐
野生技术架构师6 小时前
我有个大胆的想法,用 PostgreSQL 代替 Redis
数据库·redis·postgresql
小陶来咯12 小时前
agent × 豆包:端到端语音实时交互
网络·ai·机器人·bug·交互
倒流时光三十年14 小时前
PostgreSQL Dead Tuple 与索引膨胀深度解析
postgresql·索引膨胀·dead tuple
岳麓丹枫00114 小时前
Windows 版 smem_通过服务名获取对应进程树的内存统计
windows·postgresql
岳麓丹枫00116 小时前
Windows版本smem_通过进程名统计对应内存占用
windows·postgresql
liuzhilongDBA16 小时前
当 PostgreSQL 成为 AI 的双手——Bruce Momjian 的 MCP Server 实战
数据库·人工智能·postgresql
qq_4523962316 小时前
第八篇:《Dockerfile 指令精讲(一):FROM、RUN、COPY、ADD》
数据库·docker·postgresql
小当家.1051 天前
PostgreSQL 做向量数据库:pgvector 在 RAG 中的实战与多场景适配
数据库·人工智能·postgresql·rag
倒流时光三十年1 天前
PostgreSQL 部分索引(Partial Index)详解
数据库·postgresql·partial index·部分索引
鬼才血脉1 天前
Idea使用Tomact运行项目,控制台输出中文乱码
tomcat·bug