How to install and update OpenSSL on Debian 11.3

To Install And Update OpenSSL On Debian 11.3

Introduction:

OpenSSL is an open-source implementation of the SSL and TLS protocols that is easy to install and update OpenSSL on an Ubuntu machine, and this tutorial also deals the same.

Installation Procedure:

Step 1: Check the OS version by using the below command.

root@linuxhelp: ~# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

Step 2: Before starting the installation of OpenSSL, get the current version of OpenSSL by using the below command.

root@linuxhelp: ~# openssl version
OpenSSL 1.1.1n  15 Mar 2022

Step 3: After that, download the latest version of OpenSSL by deploying the below command.

root@linuxhelp: ~# wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
--2022-09-02 02:11:34--  https://www.openssl.org/source/openssl-1.1.1q.tar.gz
Resolving www.openssl.org (www.openssl.org)... 104.115.65.36, 2600:140f:400:1b4::c1e, 2600:140f:400:1a6::c1e
Connecting to www.openssl.org (www.openssl.org)|104.115.65.36|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9864061 (9.4M) [application/x-gzip]
Saving to: ‘openssl-1.1.1q.tar.gz’
openssl-1.1.1q.tar.gz      100%[=======================================>]   9.41M  4.33MB/s    in 2.2s    


2022-09-02 02:11:38 (4.33 MB/s) - ‘openssl-1.1.1q.tar.gz’ saved [9864061/9864061]

Step 4: Next move it to /usr/src directory by using the below command

root@linuxhelp: ~# mv openssl-1.1.1q.tar.gz  /usr/src/
root@linuxhelp: ~# cd /usr/src/
root@linuxhelp src: ~# ls -la
linux-headers-4.10.0-38 linux-headers-4.10.0-38-generic ndiswrapper-1.60 openssl-1.1.1-latest.tar.gz

Step 5: Once it is downloaded, extract the downloaded OpenSSL tar file by using the below command.

root@linuxhelp src: ~# tar xzf openssl-1.1.1q.tar.gz
root@linuxhelp src: ~# cd openssl-1.1q.2o/

Step 6: To manually compile OpenSSL and install/upgrade OpenSSL, make use of the below command.

root@linuxhelp openssl-1.1.1q #./config
Operating system: x86_64-whatever-linux2
Configuring for linux-x86_64
Configuring for linux-x86_64
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5
    no-libunbound   [experimental] OPENSSL_NO_LIBUNBOUND (skip dir)
    no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
    no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)


    no-rfc3779      [default]  OPENSSL_NO_RFC3779 (skip dir)
    no-sctp         [default]  OPENSSL_NO_SCTP (skip dir)
    no-shared       [default] 
    no-ssl-trace    [default]  OPENSSL_NO_SSL_TRACE (skip dir)
    no-ssl2         [default]  OPENSSL_NO_SSL2 (skip dir)
    no-store        [experimental] OPENSSL_NO_STORE (skip dir)
    no-unit-test    [default]  OPENSSL_NO_UNIT_TEST (skip dir)
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)
    no-zlib         [default] 
    no-zlib-dynamic [default]
.
.
make[1]: Entering directory ' /usr/src/openssl-1.0.2o/test' 
md2test.c =>  dummytest.c
rc5test.c =>  dummytest.c
jpaketest.c =>  dummytest.c
make[1]: Leaving directory ' /usr/src/openssl-1.0.2o/test

Step 7: After it is done, prepare the installation of OpenSSL by running the make command.

root@linuxhelp openssl-1.1.1q # make
making all in crypto...
make[1]: Entering directory ' /usr/src/openssl-1.1q2o/crypto' 
/usr/bin/perl ../util/mkbuildinf.pl " gcc -I. -I.. -I../include  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM"  " linux-x86_64"  > buildinf.h

.
.
make[2]: Leaving directory ' /usr/src/openssl-1.0.2o/test' 
make[1]: Leaving directory ' /usr/src/openssl-1.0.2o/test' 
making all in tools...
make[1]: Entering directory ' /usr/src/openssl-1.0.2o/tools' 
make[1]: Nothing to be done for ' all' .
make[1]: Leaving directory ' /usr/src/openssl-1.0.2o/tools' 

Step 8: After it, run the make test command as follows.

root@linuxhelp openssl-1.1.1q # make test
testing...
make[1]: Entering directory ' /usr/src/openssl-1.0.2o/test' 
make[2]: Entering directory ' /usr/src/openssl-1.0.2o' 
making all in apps...
make[3]: Entering directory ' /usr/src/openssl-1.0.2o/apps' 
make[3]: Nothing to be done for ' all' .
make[3]: Leaving directory ' /usr/src/openssl-1.0.2o/apps' 
make[2]: Leaving directory ' /usr/src/openssl-1.0.2o' 
../util/shlib_wrap.sh ./destest
Doing cbcm

Step 9: Once the command is executed, run the make install command which triggers the installation process.

linuxhelp openssl-1.1.1q # make install 
making all in crypto...
make[1]: Entering directory ' /usr/src/openssl-1.0.2o/crypto' 
making all in crypto/objects...

make[2]: Entering directory ' /usr/src/openssl-1.0.2o/crypto/objects' 
make[2]: Nothing to be done for ' all' .
make[2]: Leaving directory ' /usr/src/openssl-1.0.2o/crypto/objects' 
making all in crypto/md4...
make[2]: Entering directory ' /usr/src/openssl-1.0.2o/crypto/md4' 
make[2]: Nothing to be done for ' all' .
.
cp libcrypto.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/libcrypto.pc
cp libssl.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/libssl.pc
cp openssl.pc /usr/local/ssl/lib/pkgconfig
chmod 644 /usr/local/ssl/lib/pkgconfig/openssl. pc

Step 10: Let' s check the version now.

linuxhelp openssl-1.1.1q # openssl version
OpenSSL 1.1.1q 15 Mar 2022

Step 11: If the old version is still displayed or installed before, please make a copy of OpenSSL bin file.

root@linuxhelp openssl-1.1.1q # mv /usr/bin/openssl /root/
root@linuxhelp openssl-1.1.1q # ln -s /usr/local/ssl/bin/openssl

Step 12: Now verify the OpenSSL version.

linuxhelp openssl-1.1q.2o # sudo openssl version
OpenSSL 1.1.1q 5 jul 2022 (Library OpenSSL 1.1.1n 15 mar 2022)

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to install and update openssl on Debian 11.3. Your feedback is much welcome.

FAQ
Q
What are the prerequisites to installing OpenSSL?
A
GCC compiler is the prerequisite to installing OpenSSL.
Q
Where to download the latest version of OpenSSL?
A
download the latest version of OpenSSL by the below link wget https://www.openssl.org/source/openssl-1.1.1-latest.tar.gz
Q
Is OpenSSL free to use?
A
OpenSSL is licensed under Apache and free to get and use.
Q
What is the purpose of installing OpenSSL on Debian?
A
OpenSSL is an open-source implementation of the SSL and TLS protocols. It is so simple to install and update OpenSSL on a Debian machine
Q
How to check the version of OpenSSL in Debian?
A
use the following command to check the version of OpenSSL openssl version