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

相关推荐
GeekArch10 小时前
第28讲:避坑——AI堆栈分配错误、栈溢出BUG
c语言·人工智能·stm32·mcu·学习·bug
凌虚10 小时前
基于 PostgreSQL WAL 构建 CDC 系统:原理与工程实现
数据库·后端·postgresql
BullSmall10 小时前
PostgreSQL 14 pg_dumpall 完整备份指南
数据库·postgresql·oracle
AI多Agent协作实战派10 小时前
AI多Agent协作系统实战(十七):凌晨4点,我的AI系统在“假装工作“——3个bug同时爆炸的5小时
java·前端·bug
尸僵打怪兽17 小时前
Claude-code命令行无法下载插件
bug·插件·claude-code
Liu.7742 天前
uni-app 组件 uni-easyinput 常见 Bug 及解决方案
uni-app·bug
jnrjian3 天前
\dx Postgres 查看EXTENSION
postgresql
Lihua奏3 天前
高可用与扩展:一台 PostgreSQL 不够用之后怎么办?
postgresql
鸽芷咕3 天前
MySQL/PostgreSQL 迁移金仓 KES:LEFT JOIN 丢数据排查与避坑指南
数据库·mysql·postgresql