How to install OpenSSL libraries on Ubuntu

OpenSSL, an application security library for providing secure network communications; It is used extensively by major internet servers including HTTP websites. Also, OpenSSL is licensed under a Apache-style license, which means it’s free to use for personal and commercial purposes. If you want to install OpenSSL libraries on your Ubuntu to protect your system’s communication when connected to a network, then this article is a guide to do it.

Installing OpenSSL Libraries on Ubuntu

There are two methods to install OpenSSL libraries on Ubuntu:

Method I: From the official repository

To install openSSL libraries on Ubuntu, follow the steps outlined below:

Step 1: Update/Upgrade Repository

In all the latest Ubuntu distributions, the openSSL package is already present in the official repository. So, run the commands mentioned below to update the repository:

sudo appropriate update
sudo appropriate upgrade

Step 2: Install OpenSSL

Then run the below-mentioned command to install openSSL from the official repository. Running this command will also install the openSSL libraries:

sudo suitable To install openssl

In the output you will see a long list of openssl libraries that have been installed:

Step 3: openssl development tool

Usually simply installing the openssl package will also install all the libraries of SSL, but sometimes some libraries are left uninstalled due to lack of development tools. So it is recommended to install the development tools package using the command mentioned below:

sudo suitable To install libssl-dev

Removal of OpenSSL libraries on Ubuntu

To remove the OpenSSL libraries on Ubuntu, any of the commands mentioned below can be used:

sudo apt removes openssl

Or:

sudo apt clean openssl

Method II: By downloading the .tar file

The other method is to manually install OpenSSL using the .tar file. This allows users to install the latest version 3.0 of openSSL by following the steps outlined below:

Step 1: Install the required dependencies

To install OpenSSL manually some dependencies are required, install them with below mentioned command:

sudo suitable To install build-essential zlib1g-dev checkinstall -y

Step 2: Download the .tar file

To organize all OpenSSL libraries it was suggested to change the directory to /usr/local/src:

CD /etc/local/source/

Then download the latest version of openSSL.tar File from official site using below mentioned command:

sudo wget https://www.openssl.org/source/openssl-3.0.7.tar.gz

Step 3: Extract the .tar file

After downloading the .tar file, extract it using the command mentioned below:

sudo tar -xf openssl-3.0.7.tar.gz

Step 4: Configure and Compile OpenSSL Files

Then configure and compile openSSL files using the commands below:

CD openssl-3.0.7
sudo ./config –Prefix=/etc/local/ssl –openssldir=/etc/local/ssl shared zlib

Then compile the files into executable forms using the command mentioned below:

sudo make

Then install these executables by running the command mentioned below:

sudo make To install

Step 5: Configure link libraries

Create a new file with the nano editor to link the configured libraries:

sudo nano /etc/ld.so.conf.d/openssl-3.0.7.conf

In the file, paste the path of the libraries:

/etc/local/ssl/lib64

Then save and exit the file.

Step 6: Reload the dynamic link

Then reload the dynamic linking of configured libraries using the command mentioned below:

sudo ldconfig -v

Step 7: Verify

Finally, run the below-mentioned command to check the installed version of openSSL:

openssl version -A

Removal of OpenSSL libraries

If you want to remove the installed openSSL libraries, do this manually by removing the directory where all the libraries are present, but before doing that make sure that nothing but libraries have been stored in that directory:

sudo rm -rf CD /etc/local/source/

Diploma

All latest releases on Ubuntu have OpenSSL libraries in their repositories. It is therefore recommended to install the OpenSSL libraries from the repository using the apt command. Also, install the development tools for openSSL to successfully install all libraries. However, if you want to install the latest version of openSSL, the .tar file method is best.

Related Posts