How to update OpenSSL on Ubuntu from OpenSSL 1.0.1f to OpenSSL 1.0.2g?

6.7k Views Asked by At

I have a few steps to do this, but after executing the below steps still I'm getting the same Version.

ubuntu@ip-XXXX:~$ openssl version -v
OpenSSL 1.0.1f 6 Jan 2014
ubuntu@ip-XXXX:~$ sudo wget http://www.openssl.org/source/openssl-1.0.2g.tar.gz
ubuntu@ip-XXXX:~$ sudo tar -xvzf openssl-1.0.2g.tar.gz
ubuntu@ip-XXXX:~$ cd openssl-1.0.2g
ubuntu@ip-XXXX:~$ sudo ./config
ubuntu@ip-XXXX:~$ sudo make install
ubuntu@ip-XXXX:~$ sudo ln -sf /usr/local/ssl/bin/openssl openssl-1.0.2g
ubuntu@ip-XXXX:~$ openssl version -v
OpenSSL 1.0.1f 6 Jan 2014

Actually I excluded the results, but I didn't face any errors. Can you people give some inputs to me ?

2

There are 2 best solutions below

4
On

Yes, Finally I got the solution. I did in two cases.

OpenSSL 1.0.1f to OpenSSL 1.0.2g

ubuntu@ip-XXXX:~$ openssl version -v
OpenSSL 1.0.1f 6 Jan 2014
ubuntu@ip-XXXX:~$ sudo wget http://www.openssl.org/source/openssl-1.0.2g.tar.gz
ubuntu@ip-XXXX:~$ sudo tar -xvzf openssl-1.0.2g.tar.gz
ubuntu@ip-XXXX:~$ cd openssl-1.0.2g
ubuntu@ip-XXXX:~$ sudo apt-get update
ubuntu@ip-XXXX:~$ sudo apt-get install gcc
ubuntu@ip-XXXX:~$ sudo apt-get install make
ubuntu@ip-XXXX:~$ sudo ./config
ubuntu@ip-XXXX:~$ sudo make install
ubuntu@ip-XXXX:~$ sudo ln -sf /usr/local/ssl/bin/openssl `which openssl`
ubuntu@ip-XXXX:~$ openssl version -v
OpenSSL 1.0.2g  1 Mar 2016  

OpenSSL 1.0.1g to OpenSSL 1.0.2l

ubuntu@ip-XXXX:~$ openssl version -v
OpenSSL 1.0.2g  1 Mar 2016
ubuntu@ip-XXXX:~$ sudo wget http://www.openssl.org/source/openssl-1.0.2l.tar.gz
ubuntu@ip-XXXX:~$ sudo tar -xvzf openssl-1.0.2l.tar.gz
ubuntu@ip-XXXX:~$ cd openssl-1.0.2l
ubuntu@ip-XXXX:~$ sudo ./config
ubuntu@ip-XXXX:~$ sudo make install
ubuntu@ip-XXXX:~$ sudo ln -sf /usr/local/ssl/bin/openssl `which openssl`
ubuntu@ip-XXXX:~$ openssl version -v
OpenSSL 1.0.2l  25 May 2017  

In first case update, gcc, make installations are required if you don't have in your machines. In case any Questions? please comment.

0
On
To update the OpenSSL version follow the below steps
Log into the machine and switch to the root as below
**sudo su**
Install the gcc module if not installed yet
**yum install gcc**
Switch to the location /usr/src/  
**cd  /usr/src/**
Change the openssl-1.1.1.tar.gz to the version which you want as below
**wget ​https://www.openssl.org/source/openssl-1.1.1.tar.gz**
Extract the tar file as below
**tar -zxf openssl-1.1.1.tar.gz**
Switch to the extracted the directory
**cd /usr/src/openssl-1.1.1/**
Run the below commands by ignoring errors
**./config --prefix=/usr/local --openssldir=/usr/local/openssl**
**make**
**make test**
**make install**
**export LD_LIBRARY_PATH=/usr/local/lib64**
To make export permanent
**echo "export LD_LIBRARY_PATH=/usr/local/lib64" > /etc/profile.d/ld_library_path.sh**
**chmod ugo+x /etc/profile.d/ld_library_path.sh**
Check the version  openssl version
Recommended reboot here  openssl version