網站首頁 編程語言 正文
Ubuntu 22.04 源碼安裝 openssl 1.1 error while loading shared libraries: libssl.so.1.1: cannot open share
作者:不霽何虹丶 更新時間: 2022-09-26 編程語言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
如果一切正常應出現下方提示:
Operating system: x86_64-whatever-linux2
Configuring OpenSSL version 1.1.1q (0x1010111fL) for linux-x86_64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile
**********************************************************************
*** ***
*** OpenSSL has been successfully configured ***
*** ***
*** If you encounter a problem while building, please open an ***
*** issue on GitHub <https://github.com/openssl/openssl/issues> ***
*** and include the output from the following command: ***
*** ***
*** perl configdata.pm --dump ***
*** ***
*** (If you are new to OpenSSL, you might want to consult the ***
*** 'Troubleshooting' section in the INSTALL file first) ***
*** ***
**********************************************************************
編譯
隨后執行 make
make
等待編譯成功后將出現類似如下提示:
${LDCMD:-gcc} -pthread -m64 -Wa,--noexecstack -Wall -O3 -L. \
-o test/x509_dup_cert_test test/x509_dup_cert_test.o \
test/libtestutil.a -lcrypto -ldl -pthread
rm -f test/x509_internal_test
${LDCMD:-gcc} -pthread -m64 -Wa,--noexecstack -Wall -O3 -L. \
-o test/x509_internal_test test/x509_internal_test.o \
test/libtestutil.a libcrypto.a -ldl -pthread
rm -f test/x509_time_test
${LDCMD:-gcc} -pthread -m64 -Wa,--noexecstack -Wall -O3 -L. \
-o test/x509_time_test test/x509_time_test.o \
test/libtestutil.a -lcrypto -ldl -pthread
rm -f test/x509aux
${LDCMD:-gcc} -pthread -m64 -Wa,--noexecstack -Wall -O3 -L. \
-o test/x509aux test/x509aux.o \
test/libtestutil.a -lcrypto -ldl -pthread
make[1]: Leaving directory '/root/openssl-1.1.1q'
安裝
這時 openssl1.1
就已經編譯好了,我們還需要將動態庫放入 /usr/local/lib
中,執行 make install
即可
sudo make install
執行成功后將出現類似以下提示:
/usr/local/share/doc/openssl/html/man7/crypto.html
/usr/local/share/doc/openssl/html/man7/ct.html
/usr/local/share/doc/openssl/html/man7/des_modes.html
/usr/local/share/doc/openssl/html/man7/Ed25519.html
/usr/local/share/doc/openssl/html/man7/Ed448.html -> /usr/local/share/doc/openssl/html/man7/Ed25519.html
/usr/local/share/doc/openssl/html/man7/evp.html
/usr/local/share/doc/openssl/html/man7/ossl_store-file.html
/usr/local/share/doc/openssl/html/man7/ossl_store.html
/usr/local/share/doc/openssl/html/man7/passphrase-encoding.html
/usr/local/share/doc/openssl/html/man7/proxy-certificates.html
/usr/local/share/doc/openssl/html/man7/RAND.html
/usr/local/share/doc/openssl/html/man7/RAND_DRBG.html
/usr/local/share/doc/openssl/html/man7/RSA-PSS.html
/usr/local/share/doc/openssl/html/man7/scrypt.html
/usr/local/share/doc/openssl/html/man7/SM2.html
/usr/local/share/doc/openssl/html/man7/ssl.html
/usr/local/share/doc/openssl/html/man7/X25519.html
/usr/local/share/doc/openssl/html/man7/X448.html -> /usr/local/share/doc/openssl/html/man7/X25519.html
/usr/local/share/doc/openssl/html/man7/x509.html
設置環境變量并生效
有些可執行文件讀取的動態鏈接庫的路徑不同,這里最好設置一下動態鏈接庫的環境變量
sudo echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib" >> /etc/profile
執行 source /etc/profile
使其在當前客戶端生效
source /etc/profile
這樣就成功解決了這個問題
原文鏈接:https://blog.csdn.net/qq_43666528/article/details/127041263
相關推薦
- 2022-07-06 C#線程開發之System.Thread類詳解_C#教程
- 2022-03-22 C語言字符串函數入門_C 語言
- 2022-04-01 詳解Prometheus自動發現之file_sd_config
- 2022-10-09 .NET使用Moq進行單元測試_實用技巧
- 2024-01-13 git從某一個commit新建分支進行開發
- 2022-11-16 python3?如何解壓縮.gz文件_python
- 2022-09-06 一文詳解Python如何優雅地對數據進行分組_python
- 2022-07-01 Keras實現Vision?Transformer?VIT模型示例詳解_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支