How To Install And Update OpenSSL On Linuxmint 18.3

  To Install And Update OpenSSL On Linuxmint 18.3

OpenSSL is an open-source implementation of the SSL and TLS protocols. It is so simple to install and update OpenSSL on an Ubuntu machine, and this tutorial deals with the same. 
 

Installation

Before starting the installation of OpenSSL, get the current version of OpenSSL by using the following command.

linuxhelp ~ # openssl version
OpenSSL 1.0.2g  1 Mar 2016

After that, download the latest version of OpenSSL by deploying the following command. 

linuxhelp ~ # wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
--2018-04-13 07:02:20--  https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
Resolving www.openssl.org (www.openssl.org)... 118.215.157.42, 2600:1417:73:196::c1e, 2600:1417:73:1a0::c1e
Connecting to www.openssl.org (www.openssl.org)|118.215.157.42|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://www.openssl.org/source/openssl-1.0.2o.tar.gz [following]
--2018-04-13 07:02:22--  https://www.openssl.org/source/openssl-1.0.2o.tar.gz
Reusing existing connection to www.openssl.org:443.
HTTP request sent, awaiting response... 200 OK
Length: 5329472 (5.1M) [application/x-gzip]
Saving to: ‘ openssl-1.0.2-latest.tar.gz’ 

openssl-1.0.2-latest.tar.gz       100%[==========================================================> ]   5.08M  1.12MB/s    in 4.6s    

2018-04-13 07:02:27 (1.09 MB/s) - ‘ openssl-1.0.2-latest.tar.gz’  saved [5329472/5329472]

Lets move it to /usr/src directory

linuxhelp ~ # mv openssl-1.0.2-latest.tar.gz  /usr/src/
linuxhelp ~ # cd /usr/src/
linuxhelp src # ls
linux-headers-4.10.0-38  linux-headers-4.10.0-38-generic  ndiswrapper-1.60  openssl-1.0.2-latest.tar.gz

Once it is downloaded, extract the downloaded OpenSSL tar file as follows. 

linuxhelp src # tar xzf openssl-1.0.2-latest.tar.gz 
linuxhelp src # cd openssl-1.0.2o/

To manually compile OpenSSL and install/upgrade OpenSSL, make use of the following command. 

linuxhelp openssl-1.0.2o # ./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

 

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

linuxhelp openssl-1.0.2o # make
making all in crypto...
make[1]: Entering directory ' /usr/src/openssl-1.0.2o/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' 

After it, run the make test command as follows.

linuxhelp openssl-1.0.2o # 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
.
.
OpenSSL 1.0.2o  27 Mar 2018
built on: reproducible build, date unspecified
platform: linux-x86_64
options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) 
compiler: 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
OPENSSLDIR: " /usr/local/ssl" 

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

linuxhelp openssl-1.0.2o # 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

Let' s check the version now.

linuxhelp openssl-1.0.2o # openssl version
OpenSSL 1.0.2g  1 Mar 2016

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

linuxhelp openssl-1.0.2o # mv /usr/bin/openssl /root/
linuxhelp openssl-1.0.2o # ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

Now verify the OpenSSL version.

linuxhelp openssl-1.0.2o # openssl version
OpenSSL 1.0.2o  27 Mar 2018

With this, the method to  Install And Update OpenSSL On Linuxmint 18.3 comes to an end.

Comment
samuelg
May 22 2022
@Bushidane - sorry, but this doesn't seem to work for me on linux mint 20. I will post if I find a solution.
samuelg
May 22 2022
@Bushidane - That step looks wrong. Certainly the note doesn't match the command. Simply ignore the 'mv' command and run the 'ln' command. If you like you can copy not move the file to somewhere on your disk but I don't see why to do that to the 'root' folder.
Bushidane
May 11 2021
hey there i'm using Linux Mint 20.1 Cinnamon and iḿ trying to install the latest openssl version (openssl-3.0.0-alpha16.tar.gz but when i come to the step where i have to move it , it won allow me to can anyone help me ?
Add a comment
FAQ
Q
what is the purpose of installing the openssl on linuxmint?
A
OpenSSL is an open-source implementation of the SSL and TLS protocols. It is so simple to install and update OpenSSL on an Ubuntu machine
Q
where to download the latest version of OpenSSL?
A
download the latest version of OpenSSL to refer the below link
# wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
Q
How to install and update OpenSSL on Ubuntu 16.04?
A
refer the link as follow to install and update OpenSSL on Ubuntu https://www.linuxhelp.com/how-to-install-and-update-openssl-on-ubuntu-16-04/
Q
How can I remove the passphrase on a private key?
A
First, you should be really *really* sure you want to do this. Leaving a private key unencrypted is a major security risk. If you decide that you do have to do this check the EXAMPLES section
Q
how to check the version of openssl in linuxmint?
A
use the following command to check the version of openssl
# openssl version