Install OpenSSL on Ubuntu 22.04 - Linux Genie (2024)

OpenSSL is an open-source command-line tool used to perform different cryptographic functions. These functions include encryption, decryption, certificate management, etc. OpenSSL is a widely used SSL/TLS cryptographic protocol to secure communication and transfer data over the internet. The main aim of this article is to demonstrate how to install OpenSSL on Ubuntu 22.04.

The following two methods can be used to install OpenSSL on Ubuntu 22.04:
• Install OpenSSL via apt repository
• Install OpenSSL using wget

Method 1: Install OpenSSL on Ubuntu 22.04 via apt Repository

The steps, as follow, can be used to install OpenSSL on Ubuntu 22.04.

Step 1: Update Ubuntu Repository

Ubuntu is an open-source platform. Therefore it is strongly recommended to keep Ubuntu up to date. The following command will update Ubuntu with the latest updates.

sudo apt update && sudo apt upgrade -y

Install OpenSSL on Ubuntu 22.04 - Linux Genie (1)

The above screenshot illustrates that all the necessary files and dependencies have been installed.

Step 2: Install OpenSSL

To install OpenSSL on Ubuntu 22.04, run the below command from the terminal.

sudo apt install openssl -y

Install OpenSSL on Ubuntu 22.04 - Linux Genie (2)

It can be seen in the above screenshot that the OpenSSL package and dependencies are installed without any error.

Step 3: Verify OpenSSL

Once the OpenSSL is installed, you can verify OpenSSL with the following command.

openssl version

Install OpenSSL on Ubuntu 22.04 - Linux Genie (3)

The above message shows that the latest available version of OpenSSL has been installed on your Ubuntu 22.04.

Method 2: Install OpenSSL Using wget

Check out the provided instructions for installing OpenSSL using wget.

Step 1: Install prerequisites

Sometimes Ubuntu needs dependencies before running the packages. Type the given-below command to handle this kind of issue.

sudo apt install build-essential checkinstall zlib1g-dev -y

Install OpenSSL on Ubuntu 22.04 - Linux Genie (4)

After completion of the process, you will find the message mentioned above.

Step 2: Change the Directory

Run the given-below command to change the working directory to “/usr/local/src.” In Linux, the “/usr/local/src” directory location is used for storing source code.

cd /usr/local/src

Install OpenSSL on Ubuntu 22.04 - Linux Genie (5)

As per the given-above screenshot, the working directory has been changed successfully.

Step 3: Download the Latest file of OpenSSL

In Ubuntu, the wget retrieves the source file from the internet. To download the updated and latest version of OpenSSL, you need to copy the link from the OpenSSL website and use the copied link in the following pattern.

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

Install OpenSSL on Ubuntu 22.04 - Linux Genie (6)

As per the screenshot attached above, the OpenSSL source code in tar.gz is downloaded in “/usr/local/src.”

Step 4: Extract the openssl-3.1.0.tar.gz File

Once the OpenSSL source code is downloaded, now it’s time to extract the content of the file and use them accordingly. To extract the openssl-3.1.0.tar.gz file, the below-mentioned command can be run from the terminal.

sudo tar -xf openssl-3.1.0.tar.gz

Install OpenSSL on Ubuntu 22.04 - Linux Genie (7)

It can be seen in the above screenshot that the “tar -xf” command has run successfully.

The “ls” command will be used to list the extracted content in the destination folder.

ls

Install OpenSSL on Ubuntu 22.04 - Linux Genie (8)

Step 5: Change the working directory to manipulate the OpenSSL content

Run the given command below to change the working directory and manipulate the OpenSSL content.

cd openssl-3.1.0

Install OpenSSL on Ubuntu 22.04 - Linux Genie (9)

Step 6: OpenSSL configuration

Type the following code in your Ubuntu 22.04 terminal and hit enter to configure the OpenSSL in your Ubuntu system.

sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib

Install OpenSSL on Ubuntu 22.04 - Linux Genie (10)

After successful configuration, you will find the above-mentioned message on your screen that says OpenSSL has been successfully configured.

Step 7: Compile and Install the OpenSSL

At this stage, you need to compile the executable files and install them in your Ubuntu system. The given-below command will compile and install the packages with a single hit enter.

sudo make && sudo make install

Install OpenSSL on Ubuntu 22.04 - Linux Genie (11)

According to the above-mentioned screenshots, the OpenSSL packages are compiled and installed without any error.

Step 8: Verify the OpenSSL

To confirm whether the OpenSSL packages are installed or not, run the below-given command.

openssl version -a

Install OpenSSL on Ubuntu 22.04 - Linux Genie (12)

The “version -a” command displayed all the available information about OpenSSL.

Uninstall OpenSSL from Ubuntu 22.04

The purge command in Ubuntu is used to remove the package files as well as the dependencies. To remove the package and configuration files completely, the below-mentioned “purge” command can be run from the terminal.

sudo apt purge openssl -y

Install OpenSSL on Ubuntu 22.04 - Linux Genie (13)

As shown in the above screenshot, the OpenSSL packages files, configuration, and dependencies have been removed from Ubuntu 22.04.

The “apt autoremove openssl” command can also be used to remove the other dependencies related to OpenSSL:

sudo apt autoremove openssl -y

Install OpenSSL on Ubuntu 22.04 - Linux Genie (14)

It can be seen in the screenshot attached above that the other dependency files have also been removed from your Ubuntu system.

The command “version -a” will be used to show the available information about OpenSSL.

openssl version -a

Install OpenSSL on Ubuntu 22.04 - Linux Genie (15)

As per the above screenshot, there is no OpenSSL file or directory, meaning the OpenSSL has been removed from Ubuntu 22.04.

Bonus Tips

While downloading the OpenSSL source code from the link, you may face authenticity certificate problems, as shown in the below screenshot. But don’t worry, it can be solved with a single-line command.

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

Install OpenSSL on Ubuntu 22.04 - Linux Genie (16)

The command given below will be used to solve this problem.

sudo apt install ca-certificates -y

Install OpenSSL on Ubuntu 22.04 - Linux Genie (17)

It can be absorbed from the above-mentioned message that the ca-certificates packages are installed in your machine without any error. In Linux, the “ca-certificates” is a trusted root certificate that verifies the authenticity of SSL/TLS connections.

Conclusion

OpenSSL can be installed on Ubuntu 22.04. OpenSSL is a command used to communicate and transfer data securely. In this article, we have practically demonstrated the two different methods of installation and configuration of OpenSSL on Ubuntu. Additionally, we have also illustrated the uninstallation process of OpenSSL.

Install OpenSSL on Ubuntu 22.04 - Linux Genie (2024)

FAQs

How do I manually install OpenSSL in Linux? ›

In most Linux distributions, OpenSSL can be installed using the command, sudo apt-get install openssl or sudo yum install openssl . You can verify that OpenSSL is properly added with the command, openssl version . This command will install OpenSSL on your system.

How to install OpenSSL package in Ubuntu? ›

Ubuntu 20.04 LTS
  1. sudo apt-get update && sudo apt-get upgrade. sudo apt install build-essential checkinstall zlib1g-dev -y.
  2. cd /usr/local/src/ wget https://www. openssl. org/source/openssl-1.1.1k. tar. ...
  3. cd /etc/ld. so. conf. d/ ...
  4. mv /usr/bin/c_rehash /usr/bin/c_rehash. BEKUP. mv /usr/bin/openssl /usr/bin/openssl. BEKUP.

How do you update OpenSSL? ›

To update OpenSSL on Windows, first download the latest version from the official OpenSSL website. Uninstall the current version from your system, and then run the installer for the new version. Follow the installation steps, ensuring it's added to your system's PATH.

How to install SSL package in Linux? ›

How to Install an SSL Certificate on Linux Server
  1. The installation process of SSL Certificates on a Linux server is very easy. ...
  2. Step 1: Very first step is to Login to your WHM account.
  3. Step 2: Move towards Home à click on SSL/TLS à Install an SSL Certificate on a Domain.
Mar 15, 2024

How to install OpenSSL step by step? ›

To install OpenSSL on Windows, you must download the package, extract the files to a directory, add the OpenSSL bin directory to your system PATH environment variable, and verify the installation through a command prompt.

What is the command to install OpenSSL? ›

Open a Command Prompt (CMD) as Administrator. Run the following command: SET OPENSSL_CONF=C:\OpenSSL-Win32\bin\openssl. cfg.

Is OpenSSL installed on Linux by default? ›

openssl is installed by default on Arch Linux (as a dependency of coreutils). There are various OpenSSL library bindings available for developers: python-pyopenssl.

What is the OpenSSL package in Linux? ›

OpenSSL is an open-source command line tool that is commonly used to generate private keys, create CSRs, install your SSL/TLS certificate, and identify certificate information.

How to check OpenSSL version in Linux? ›

To check the OpenSSL version number, you should have basic familiarity with the command-line interface and access to a terminal on Linux (macOS or Windows). To find out which version of OpenSSL your system uses, you can use the openssl version command. This command prints out the version information in the terminal.

What is the newest version of OpenSSL? ›

OpenSSL
ReleaseReleasedLatest
3.0 ( LTS )2 years and 7 months ago (07 Sep 2021)3.0.13 (30 Jan 2024)
1.1.1 ( LTS )5 years and 7 months ago (11 Sep 2018)1.1.1w (12 Sep 2023)
1.1.07 years ago (25 Aug 2016)1.1.0l (10 Sep 2019)
1.0.2 ( LTS )9 years ago (22 Jan 2015)1.0.2u (20 Dec 2019)
3 more rows
Apr 12, 2024

How to update the OpenSSL version in Linux? ›

Please find the below steps to update openssl on your server:
  1. Check your openssl version. # openssl version. ...
  2. Download the latest version of openssl from: http://www.openssl.org/source/ ...
  3. Extract openssl-1.0.1g.tar.gz. Go to openssl-1.0.1g directory. ...
  4. Done.
  5. Check the if you you have the latest version.

Where is OpenSSL installed in Linux? ›

The OpenSSL configuration file is located at /etc/ssl/openssl. cnf and is used both by the library itself and the command-line tools included in the package.

Where is OpenSSL installed? ›

Go to where the openssl.exe is, which should be at “This PC > Windows (C:) > Program Files > OpenSSL - Win64 > bin” and select that folder. Click OK.

How to manually install SSL certificate Ubuntu? ›

Steps to Install an SSL Certificate on Ubuntu Server
  1. Step 1: Copy your certificate files to your server. ...
  2. Step 2: Edit the Apache.config file. ...
  3. Step 3: Configure the Virtual Host block. ...
  4. Step 4: Test the .config file. ...
  5. Step 5: Restart Apache.

Where is OpenSSL installed on Linux? ›

The OpenSSL configuration file is located at /etc/ssl/openssl.

How to install OpenSSL 1.1 on Linux? ›

How To Install OpenSSL 1.1. 1 on CentOS 7
  1. Requirements. Upgrade the system yum -y update. ...
  2. Configure, build and install OpenSSL. Uncompress the source file tar -xzvf openssl-1.1.1k.tar.gz. ...
  3. Export library path. Create environment variable file vim /etc/profile.d/openssl.sh. ...
  4. Verify the OpenSSL version. openssl version.

How to check OpenSSL installed or not in Linux? ›

To check the OpenSSL version number, you should have basic familiarity with the command-line interface and access to a terminal on Linux (macOS or Windows). To find out which version of OpenSSL your system uses, you can use the openssl version command. This command prints out the version information in the terminal.

Top Articles
Latest Posts
Article information

Author: Duncan Muller

Last Updated:

Views: 6182

Rating: 4.9 / 5 (59 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Duncan Muller

Birthday: 1997-01-13

Address: Apt. 505 914 Phillip Crossroad, O'Konborough, NV 62411

Phone: +8555305800947

Job: Construction Agent

Hobby: Shopping, Table tennis, Snowboarding, Rafting, Motor sports, Homebrewing, Taxidermy

Introduction: My name is Duncan Muller, I am a enchanting, good, gentle, modern, tasty, nice, elegant person who loves writing and wants to share my knowledge and understanding with you.