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

相关推荐
IvorySQL18 分钟前
PostgreSQL 日报|逻辑解码 DDL 子事务缺陷修复(10 月 12 日)
数据库·postgresql
瀚高PG实验室2 小时前
瀚高数据库序列介绍、使用及值不连续、重复写入等现象处理
数据库·postgresql·瀚高数据库
这个DBA有点耶2 小时前
PostgreSQL HOT更新:频繁更新表的索引膨胀根因与fillfactor调优
数据库·sql·postgresql
ss2735 小时前
PG实战笔记 | 04 PostgreSQL市场地位与实际案例
数据库·postgresql
码匠许师傅7 小时前
【C++三方组件】libpqxx:PostgreSQL 的 C++ 客户端
开发语言·c++·postgresql
瀚高PG实验室7 小时前
业务无法通过hgproxy访问数据库
数据库·postgresql·瀚高数据库
snhna19 小时前
向量数据库深度实战:从 HNSW 到 pgvector、Milvus 选型与 RAG 落地
数据库·人工智能·python·postgresql·milvus
周小董21 小时前
[1369]Windows上安装PostgreSQL
数据库·windows·postgresql
ss2731 天前
03 -AI时代首先数据库-PostgreSQL发展历史:从伯克利到AI数据库
postgresql
东风微鸣1 天前
精简 Ubuntu Linux 固件包:每个 N100 节点省下约 450 MB
linux·ubuntu·postgresql