網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
Ubuntu 22.04 源碼安裝 openssl 1.1 error while loading shared libraries: libssl.so.1.1: cannot open share
作者:不霽何虹丶 更新時(shí)間: 2022-09-26 編程語(yǔ)言libssl.so.1.1: cannot open shared object file
使用 Ubuntu 22.04 時(shí),有時(shí)候會(huì)遇到如下錯(cuò)誤
error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
這是因?yàn)閁buntu 22.04 默認(rèn)使用的是 openssl3.0
,但是大多為 Ubuntu 生成的可執(zhí)行文件依賴 openssl 1.1
安裝Openssl 1.1
我們可以采取源碼安裝的方式解決這個(gè)問(wèn)題
下載源碼包并解壓
首先確定已經(jīng)安裝下載工具
apt install -y wget
隨后執(zhí)行下載操作
wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
對(duì)下載的文件解壓并進(jìn)入到文件夾中
tar xvf openssl-1.1.1q.tar.gz && cd openssl-1.1.1q
安裝 GCC、Perl、Make
首先確保 Ubuntu 22.04 已經(jīng)安裝 GCC
Perl
Make
工具
如果你不知道這幾樣是什么,那么請(qǐng)執(zhí)行安裝命令
sudo apt install -y perl gcc make
執(zhí)行 config 配置
在成功安裝上述工具后執(zhí)行 config
命令
./config
如果一切正常應(yīng)出現(xiàn)下方提示:
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) ***
*** ***
**********************************************************************
編譯
隨后執(zhí)行 make
make
等待編譯成功后將出現(xiàn)類似如下提示:
${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'
安裝
這時(shí) openssl1.1
就已經(jīng)編譯好了,我們還需要將動(dòng)態(tài)庫(kù)放入 /usr/local/lib
中,執(zhí)行 make install
即可
sudo make install
執(zhí)行成功后將出現(xiàn)類似以下提示:
/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
設(shè)置環(huán)境變量并生效
有些可執(zhí)行文件讀取的動(dòng)態(tài)鏈接庫(kù)的路徑不同,這里最好設(shè)置一下動(dòng)態(tài)鏈接庫(kù)的環(huán)境變量
sudo echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib" >> /etc/profile
執(zhí)行 source /etc/profile
使其在當(dāng)前客戶端生效
source /etc/profile
這樣就成功解決了這個(gè)問(wèn)題
原文鏈接:https://blog.csdn.net/qq_43666528/article/details/127041263
相關(guān)推薦
- 2022-10-03 Android使用AudioRecord實(shí)現(xiàn)錄音功能_Android
- 2022-03-21 oracle中commit之后進(jìn)行數(shù)據(jù)回滾的方法_oracle
- 2022-06-23 Python在畫(huà)圖時(shí)使用特殊符號(hào)的方法總結(jié)_python
- 2022-03-20 .NET?6開(kāi)發(fā)TodoList應(yīng)用之實(shí)現(xiàn)接口請(qǐng)求驗(yàn)證_實(shí)用技巧
- 2022-06-21 C語(yǔ)言分別實(shí)現(xiàn)棧和隊(duì)列詳解流程_C 語(yǔ)言
- 2023-03-17 C語(yǔ)言編程實(shí)例之輸出指定圖形問(wèn)題_C 語(yǔ)言
- 2023-03-16 Python?import導(dǎo)入上級(jí)目錄文件的方法_python
- 2022-08-01 C++簡(jiǎn)單又好用的基本運(yùn)算符重載_C 語(yǔ)言
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支