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

相关推荐
yanwumuxi7 小时前
Docker记录:误删宿主机挂载目录导致 PostgreSQL 数据丢失
docker·postgresql·容器
PGCCC_8 小时前
PostgreSQL 报 no pg_hba.conf entry?认证配置 pg_hba.conf 一次讲透
postgresql
Harry Lei8 小时前
长期记忆系统的设计与实现
spring boot·postgresql·embedding
jonyleek16 小时前
低代码平台的数据架构设计:动态表单存储与查询优化
低代码·postgresql·开源·数据架构·动态表单·jvs低代码平台·jvs低代码
Logintern091 天前
PostgreSQL 的 ORDER BY 多列排序
数据库·postgresql
微软技术分享1 天前
Ubuntu 本地部署Ollama+OpenWebUI教程
数据库·ubuntu·postgresql
大喵桑丶1 天前
AlmaLinux 9 上基于 PostgreSQL + Nginx 部署高可用轻量级 Gitea 服务
nginx·postgresql·gitea
xuefuhe1 天前
CLion2026本地阅读PostgreSQL源码实现跳转
postgresql
我星期八休息1 天前
软件测试—从认识到BUG
考研·安全·bug
数智启示录2 天前
PostgreSQL 内存调优实战(第 12 篇):work_mem 只调大 64 倍,峰值为什么远不止 64 倍
运维·数据库·经验分享·postgresql·面试