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

相关推荐
清静诗意11 小时前
Ubuntu 下 PostgreSQL 安装与配置完整指南
linux·ubuntu·postgresql
资深web全栈开发11 小时前
PostgreSQL 实战指南(面向 MySQL 开发者)
数据库·mysql·postgresql
hello_fracong11 小时前
PostgreSQL (零-1) Windows安装PostgreSQL
数据库·windows·postgresql
阿奇__14 小时前
el-table有固定列时样式bug
vue.js·elementui·bug
羑悻的小杀马特1 天前
openGauss 应用开发测评(PostgreSQL 接入方式)
数据库·postgresql·opengauss
踏浪无痕2 天前
PostgreSQL实例进程:从启动到运行的完整故事
数据库·postgresql
yaso_zhang2 天前
jetson开机之前自启脚本sudo ifconfig 如何不需要输入密码
数据库·postgresql
残花月伴2 天前
天机学堂——day1(修改bug)
servlet·bug
std860212 天前
微软 Win11 经典版 Outlook 曝 BUG,加速 SSD 损耗
microsoft·bug·outlook
花花鱼2 天前
android 网络访问拦截器使用后的bug处理
bug