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

相关推荐
PGCCC2 小时前
Ubuntu 安装 PostgreSQL 16 完整教程(2026):从仓库配置到远程连接
linux·ubuntu·postgresql
jnrjian18 小时前
postgres database 更换用户
数据库·postgresql
李昊哲小课1 天前
Ubuntu24.04 PostgreSQL 18 完整安装与配置教程
ubuntu·postgresql
凌云拓界1 天前
NodeVerdict | 性能门禁:把追踪数据变成 CI 规则
ci/cd·信息可视化·开源·node.js·bug·数据可视化·安全架构
IvorySQL1 天前
PostgreSQL 日报|复制槽泄漏修复(8 月 6 日)
数据库·postgresql
喜欢的名字被抢了1 天前
FastAPI 接入异步 PostgreSQL 完成任务 CRUD 与数据库迁移
数据库·postgresql·fastapi
qq21084629531 天前
PostgreSQL、SQLite、Redis、TDengine
redis·postgresql·sqlite
PC2005-cloud1 天前
PgVector从入门到实战:用PostgreSQL做向量检索,附SpringBoot+MyBatisPlus整合
数据库·spring boot·postgresql
jaboo121 天前
postgresql从入门到精通
数据库·postgresql·langchain
IvorySQL2 天前
PostgreSQL 日报|修复 WAL 归档恢复竞态条件(8 月 5 日)
数据库·postgresql·区块链