redhad6中openssl离线升级3.2版本



1、依赖包安装

下载依赖包

# 如果你的环境是离线环境,先用自己电脑上的可以连接互联网的虚拟机下载到本地,在上传到离线环境
yumdownloader --destdir=/tmp/bao --resolve openssl-devel perl-IPC-Cmd  zlib zlib-devel libffi libffi-devel gcc gcc-c++

安装依赖包

cd /tmp/bao
rpm -Uvh --force --nodeps *.rpm


2、备份原来openssl

mv  /usr/bin/openssl /usr/bin/openssl.bak  
mv /usr/include/openssl /usr/include/openssl.bak


3、编译安装openss3.2.0

下载openssl-3.2

# 如果你的环境是离线环境,先用自己电脑上的可以连接互联网的虚拟机下载到本地,在上传到离线环境
cd /tmp
wget https://ftp.openssl.org/source/openssl-3.2.0.tar.gz

配置编译

tar -zxvf   openssl-3.2.0.tar.gz    # 解压安装包
cd openssl-3.2.0

# --prefix和--openssldir =指定安装目录、配置文件目录 。shared 来创建一个共享库。zlib =使用zlib库启用压缩
./config --prefix=/usr/local/openssl-3.2.0 --openssldir=/usr/local/openssl-3.2.0/ssl shared zlib

返回日志:

[root@redhad6 openssl-3.2.0]# ./config --prefix=/usr/local/openssl-3.2.0 --openssldir=/usr/local/openssl-3.2.0/ssl shared zlib
Configuring OpenSSL version 3.2.0 for target linux-x86_64
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   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.md file first)      ***
***                                                                ***
**********************************************************************

执行编译和安装命令

make && make install


4、添加新的符号链接和指定lib路径

/usr/local/openssl-3.2.0/ 路径为上一步骤指定的安装目录 --prefix 安装路径


添加新的符号链接

ln -s /usr/local/openssl-3.2.0/bin/openssl  /usr/bin/openssl
ln -s /usr/local/openssl-3.2.0/include/openssl  /usr/include/openssl

指定lib路径

echo "/usr/local/openssl-3.2.0/lib64"  >>  /etc/ld.so.conf

# 重新加载动态链接库
ldconfig -v   


5、验证安装

# 查看安装版本
openssl version -a

# 查看动态依赖关系
ldd /usr/local/openssl-3.2.0/bin/openssl
# 查看安装路径
which openssl



参考:

1、[CentOS6.5下升级openssl-1.1.1g与openssh-8.3p1-腾讯云开发者社区-腾讯云 (tencent.com)]
2、/etc/ld.so.conf详解

  • 14
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值