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

相关推荐
qq_2837200511 分钟前
Python3 模块精讲:psycopg2(第三方)- 连接 PostgreSQL
数据库·postgresql
半天法师12 分钟前
Bug 记录:UE 结构体转 JSON 时 Key 字段大小写异常 (Editor 与打包后表现不一致)
ai·ue5·json·bug
张小俊_14 分钟前
WPF 跨线程 UI 更新与硬编码赋值引发的 Bug 排查
c#·bug·wpf
Mr.朱鹏10 小时前
【Python 进阶 | 第四篇】Psycopg3 + Flask 实现 PostgreSQL CRUD 全流程:从连接池到RESTful接口
python·postgresql·flask·virtualenv·fastapi·pip·tornado
鸿儒51720 小时前
记录一个C++ Windows程序移植到Linux系统的bug
开发语言·c++·bug
Python私教2 天前
HermesAgent 终端工具 Windows 兼容性修复实战:两个 Bug 的排查与解决
windows·bug
瀚高PG实验室2 天前
pgroonga全文检索插件的BUG
数据库·postgresql·bug·瀚高数据库
hudson20222 天前
Postgres 实现自增的三种方式
postgresql
dblens 数据库管理和开发工具2 天前
DBLens for PostgreSQL 正式发布|把 PostgreSQL 开发与管理带进 AI + Agent 时代
数据库·人工智能·postgresql
l1t3 天前
DeepSeek总结的面向 PostgreSQL 分析和 HTAP 工作负载的两种高性能表访问方法
数据库·postgresql