去发现生活中的美好,记录生活中的点点滴滴

linux 升级openssl

linux admin 220℃

1、安装依赖:

sudo yum -y install perl perl-devel gcc gcc-c++

2、查看版本:

openssl version

3、下载解压:

cd /usr/local/src
wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz
tar xzvf ./OpenSSL_1_1_1c.tar.gz
cd openssl-OpenSSL_1_1_1c/

4、安装:

./config
make && make install

5、备份:

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

6、替换版本:

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

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

#sudo mv /usr/bin/openssl /usr/bin/oldopenssl
#sudo ln -s /usr/local/bin/openssl /usr/bin/openssl

6、查看版本:

openssl version

7、更新链接库:

echo "/usr/local/ssl/lib" >> /etc/ld.so.conf

8、如果报错:

/usr/local/openssl/bin/openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
/usr/local/openssl/bin/openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
则执行:
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1

完成。

转载请注明:永盟博客 » linux 升级openssl

喜欢 (1)