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

相关推荐
tkokof118 小时前
捉虫(Bug)再记
游戏·bug·游戏开发
IvorySQL18 小时前
PostgreSQL 18.4、17.10、16.14、15.18、14.23 版本正式发布
数据库·postgresql·区块链
会周易的程序员19 小时前
AI 编程助手:从“猫弄乱的线团”到“击鼓传花”的 Bug 修复
c++·人工智能·物联网·架构·bug·iot
樱桃花下的小猫20 小时前
幻兽帕鲁 - 服务器反作弊误踢 BUG 修复指南
服务器·bug·幻兽帕鲁·云鸢互联·零门槛一键开服·幻兽帕鲁服务器
Cry丶2 天前
WebFlux + R2DBC 场景下的分库分表预研:从架构选型到落地风险
mysql·postgresql·数据库架构·shardingsphere·分库分表·webflux·r2dbc
岳麓丹枫0012 天前
Windows 环境下创建 pgcrypto 扩展失败问题分析解决
windows·postgresql
丷丩2 天前
Postgresql基础实践教程(五)
数据库·postgresql
倒流时光三十年2 天前
PostgreSQL COPY命令:高效数据导入的最佳实践
数据库·postgresql
岳麓丹枫0012 天前
PostgreSQL 15.7 CDC → Flink → Kafka 操作笔记
postgresql·flink·kafka
岳麓丹枫0012 天前
PG HA环境备机pg_basebackup建备库报错
postgresql