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

相关推荐
2601_962181961 小时前
数据库之PostgreSQL详解
数据库·postgresql
pnoker2 小时前
IoT DC3 时序存储选型:四款数据库可插拔
数据库·物联网·postgresql·时序数据库·influxdb·tdengine·iotdb
福大大架构师每日一题7 小时前
RAGFlow v0.27.1 发布:新增 Azure DevOps、You.com 搜索,修复海量 Bug,性能大幅提升!
bug·azure·devops
树码小子8 小时前
测试(6) - bug篇(上)
软件测试·bug
xuefuhe18 小时前
PostgreSQL源码1:select 1
postgresql
IvorySQL20 小时前
PostgreSQL 日报|内核多项缺陷修复与数据校验补丁推进(8 月 27 日)
数据库·postgresql·区块链
周杰伦的稻香1 天前
[bug]npx @deepseek-ai/dsh plugin ...无限吃内存卡死
bug
Cloud云卷云舒1 天前
【运营商数据库】实战淬炼,规模落地 | 中国移动HaishanDB年中总结会圆满召开
数据库·postgresql·ai-native·haishandb·移动云海山数据库
xuefuhe2 天前
PostgreSQL Page Layout
postgresql
云贝贝贝2 天前
PostgreSQL 生产环境备份恢复与高可用实战
数据库·postgresql