Update the Ubuntu repository and install package dependencies
sudo apt update
sudo apt install build-essential checkinstall zlib1g-dev -y
Download OpenSSL
cd /usr/local/src/
wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz
Now extract the openssl.tar.gz file, and go to the ‘openssl’ directory.
tar -xf openssl-1.0.2o.tar.gz
cd openssl-1.0.2o
Install OpenSSL
cd /usr/local/src/openssl-1.0.2o
Configure and compile OpenSSL
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
make
make test
make install
Configure Link Libraries
cd /etc/ld.so.conf.d/
vim openssl-1.0.2o.conf
Paste the openssl library path directory.
/usr/local/ssl/lib
Save and exit.
Reload the dynamic link
sudo ldconfig -v
Configure OpenSSL Binary
mv /usr/bin/c_rehash /usr/bin/c_rehash.BEKUP
mv /usr/bin/openssl /usr/bin/openssl.BEKUP
Edit the ‘/etc/environment’ file using vim.
vim /etc/environment
Now add the new OpenSSL binary directory as below
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/ssl/bin"
Save and exit.
Reload the environment file and test the new updated binary PATH.
source /etc/environment
echo $PATH
which openssl
Testing
openssl version -a
Tagged: Install openssl, Openssl, Ubuntu
Leave a Reply