{"id":6133,"date":"2015-04-01T01:06:26","date_gmt":"2015-03-31T17:06:26","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=6133"},"modified":"2023-09-28T07:29:47","modified_gmt":"2023-09-28T07:29:47","slug":"install-update-openssl-centos","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/install-update-openssl-centos\/","title":{"rendered":"How to Install and Update OpenSSL on CentOS"},"content":{"rendered":"<p><a href=\"https:\/\/webhostinggeeks.com\/blog\/openssl-explained-in-simple-terms\/\">OpenSSL<\/a> is a robust, widely-used toolkit that provides support for the <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-ssl-secure-sockets-layer-technology-explained\/\">Secure Sockets Layer (SSL)<\/a> and <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-tls-transport-layer-security-explained\/\">Transport Layer Security (TLS)<\/a> protocols, as well as a general-purpose cryptography library. Installing and maintaining the latest version of OpenSSL is essential for ensuring secure communication and data protection on your <a href=\"https:\/\/webhostinggeeks.com\/blog\/what-is-centos-beginners-guide-centos-linux-distro\/\">CentOS system<\/a>.<\/p>\n<p><img decoding=\"async\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-1024x661.png\" alt=\"open ssl\" width=\"1024\" height=\"661\" class=\"alignnone size-large wp-image-13676 img-fluid lazyload\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-1024x661.png 1024w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-300x194.png 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-128x83.png 128w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-420x271.png 420w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-540x349.png 540w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-720x465.png 720w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-960x620.png 960w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-1140x736.png 1140w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl-1115x720.png 1115w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2015\/04\/open-ssl.png 1174w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/661;\" \/><\/p>\n<p>In this short tutorial, we will discuss how to install and update OpenSSL using the package manager, and how to build it from source if you require a newer version than what is available in the CentOS repositories.<\/p>\n<p>First, we will walk you through the process of installing OpenSSL on CentOS using the yum package manager. Next, we will explain how to update the OpenSSL package to the latest version available in the CentOS repositories. Lastly, we will demonstrate how to build and install OpenSSL from source, which can be useful if you need a newer version than what is available in the default repositories.<\/p>\n<p>By the end, you will be able to install, update, and build OpenSSL from the source on your CentOS system, ensuring that you have access to the latest security patches and features. This knowledge is crucial for maintaining a secure and stable CentOS environment, particularly for tasks related to secure <a href=\"https:\/\/webhostinggeeks.com\/best\/web-server\/\">web servers<\/a>, data encryption, and certificate management.<\/p>\n<h2>How to Install OpenSSL on CentOS<\/h2>\n<h3>Step 1: Update Your System<\/h3>\n<p>Before installing any new software, it&#8217;s a good practice to update your system packages to their latest versions. You can do this by running the following command:<\/p>\n<pre>\r\nsudo yum update -y\r\n<\/pre>\n<p>This command updates all installed packages on your CentOS system.<\/p>\n<h3>Step 2: Install the OpenSSL Package<\/h3>\n<p>OpenSSL is typically included in the base repository of CentOS, so you can install it using the yum package manager. To install OpenSSL, run:<\/p>\n<pre>\r\nsudo yum install -y openssl\r\n<\/pre>\n<p>This command installs the OpenSSL package and its dependencies.<\/p>\n<h3>Step 3: Verify the OpenSSL Installation<\/h3>\n<p>After the installation is complete, you can verify that OpenSSL is installed correctly by checking its version. To do this, run:<\/p>\n<pre>\r\nopenssl version\r\n<\/pre>\n<p>The output should display the installed OpenSSL version.<\/p>\n<h3>Step 4: (Optional) Install the OpenSSL Development Package<\/h3>\n<p>If you are a developer or need to compile software that depends on the OpenSSL library, you might need to install the development package, which includes the header files and development libraries for OpenSSL. To install the OpenSSL development package, run:<\/p>\n<pre>\r\nsudo yum install -y openssl-devel\r\n<\/pre>\n<h2>Updating OpenSSL to the Latest Version on CentOS<\/h2>\n<p>To update OpenSSL to the latest version on CentOS, follow these steps:<\/p>\n<h3>Step 1: Update Your System<\/h3>\n<p>First, update your system packages to their latest versions. You can do this by running the following command:<\/p>\n<pre>\r\nsudo yum update -y\r\n<\/pre>\n<p>This command updates all installed packages on your CentOS system, including OpenSSL if there is a new version available in the default repositories.<\/p>\n<h3>Step 2: Check for Available OpenSSL Updates<\/h3>\n<p>After updating your system, you can check if a new version of OpenSSL is available in the repositories:<\/p>\n<pre>\r\nsudo yum list available openssl\r\n<\/pre>\n<p>If a newer version is available, you can proceed with the update.<\/p>\n<h3>Step 3: Update OpenSSL<\/h3>\n<p>If a new version of OpenSSL is available in the repositories, update the package by running:<\/p>\n<pre>\r\nsudo yum update -y openssl\r\n<\/pre>\n<p>This command updates the OpenSSL package to the latest version available in the repositories.<\/p>\n<h3>Step 4: Verify the Updated OpenSSL Version<\/h3>\n<p>After updating OpenSSL, you can verify that the latest version is installed by checking its version. To do this, run:<\/p>\n<pre>\r\nopenssl version\r\n<\/pre>\n<p>The output should display the updated OpenSSL version.<\/p>\n<p>Please note that the latest version available in the CentOS repositories may not always be the absolute latest version of OpenSSL. If you need a newer version than what is available in the repositories, you may need to build it from the source or use a third-party repository.<\/p>\n<h2>Building OpenSSL from Source on CentOS<\/h2>\n<p>If you need a newer version of OpenSSL than what is available in the CentOS repositories, you can build it from the source. Here&#8217;s how:<\/p>\n<h3>Step 1: Install Required Dependencies<\/h3>\n<p>Before you can build OpenSSL from the source, you need to install some required dependencies. Run the following command to install the necessary packages:<\/p>\n<pre>\r\nsudo yum install -y gcc make perl wget\r\n<\/pre>\n<h3>Step 2: Download the Latest OpenSSL Source Code<\/h3>\n<p>Visit the OpenSSL official website (https:\/\/www.openssl.org\/source\/) and find the latest OpenSSL version&#8217;s download link. Then, use the wget command to download the source code to your CentOS system:<\/p>\n<pre>\r\nwget https:\/\/www.openssl.org\/source\/openssl-&lt;version&gt;.tar.gz\r\n<\/pre>\n<p>Replace &lt;version&gt; with the desired version number.<\/p>\n<h3>Step 3: Extract the Source Code<\/h3>\n<p>After downloading the source code, extract the contents of the tarball by running:<\/p>\n<pre>\r\ntar -xf openssl-&lt;version&gt;.tar.gz\r\n<\/pre>\n<p>This command extracts the source code into a directory named openssl-&lt;version&gt;.<\/p>\n<h3>Step 4: Compile and Install OpenSSL<\/h3>\n<p>Navigate to the extracted directory:<\/p>\n<pre>\r\ncd openssl-&lt;version&gt;\r\n<\/pre>\n<p>Configure the OpenSSL build using the following command:<\/p>\n<pre>\r\n.\/config --prefix=\/usr\/local\/openssl --openssldir=\/usr\/local\/openssl\r\n<\/pre>\n<p>The &#8211;prefix and &#8211;openssldir options specify the installation directory for the OpenSSL binaries and configuration files, respectively.<\/p>\n<p>Compile and install OpenSSL by running:<\/p>\n<pre>\r\nsudo make\r\nsudo make install\r\n<\/pre>\n<h3>Step 5: Update System Path<\/h3>\n<p>Add the newly installed OpenSSL to your system&#8217;s path by creating a new file in the \/etc\/ld.so.conf.d\/ directory:<\/p>\n<pre>\r\nsudo echo \"\/usr\/local\/openssl\/lib\" > \/etc\/ld.so.conf.d\/openssl.conf\r\n<\/pre>\n<p>Update the system&#8217;s dynamic linker runtime bindings:<\/p>\n<pre>\r\nsudo ldconfig\r\n<\/pre>\n<h3>Step 6: Verify the OpenSSL Installation<\/h3>\n<p>After building and installing OpenSSL from the source, verify that the new version is installed correctly by checking its version:<\/p>\n<pre>\r\n\/usr\/local\/openssl\/bin\/openssl version\r\n<\/pre>\n<h3>Commands Mentioned:<\/h3>\n<ul>\n<li><span class=\"fw-bold\">sudo yum update -y<\/span> &#8211; Updates all installed packages on the CentOS system.<\/li>\n<li><span class=\"fw-bold\">sudo yum install -y openssl<\/span> &#8211; Installs the OpenSSL package and its dependencies.<\/li>\n<li><span class=\"fw-bold\">openssl version<\/span> &#8211; Displays the installed OpenSSL version.<\/li>\n<li><span class=\"fw-bold\">sudo yum install -y openssl-devel<\/span> &#8211; Installs the OpenSSL development package with header files and development libraries.<\/li>\n<li><span class=\"fw-bold\">sudo yum list available openssl<\/span> &#8211; Lists the available OpenSSL versions in the repositories.<\/li>\n<li><span class=\"fw-bold\">sudo yum update -y openssl<\/span> &#8211; Updates the OpenSSL package to the latest version available in the repositories.<\/li>\n<li><span class=\"fw-bold\">sudo yum install -y gcc make perl wget<\/span> &#8211; Installs the required dependencies for building OpenSSL from source.<\/li>\n<li><span class=\"fw-bold\">wget https:\/\/www.openssl.org\/source\/openssl-&lt;version&gt;.tar.gz<\/span> &#8211; Downloads the OpenSSL source code.<\/li>\n<li><span class=\"fw-bold\">tar -xf openssl-&lt;version&gt;.tar.gz<\/span> &#8211; Extracts the OpenSSL source code.<\/li>\n<li><span class=\"fw-bold\">.\/config &#8211;prefix=\/usr\/local\/openssl &#8211;openssldir=\/usr\/local\/openssl<\/span> &#8211; Configures the OpenSSL build.<\/li>\n<li><span class=\"fw-bold\">sudo make<\/span> &#8211; Compiles OpenSSL.<\/li>\n<li><span class=\"fw-bold\">sudo make install<\/span> &#8211; Installs OpenSSL.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>By following these instructions, you have ensured that your system has the latest version of OpenSSL, providing you with the latest security features and patches. The importance of maintaining an up-to-date OpenSSL installation cannot be overstated, as it plays a vital role in secure communication, data encryption, and certificate management.<\/p>\n<p>With the knowledge acquired, you can confidently manage your OpenSSL installation, tailoring it to your specific needs and requirements. Whether you choose to install OpenSSL via the package manager or build it from a source, you now have the tools and understanding necessary to keep your CentOS system secure and up-to-date.<\/p>\n<p>We encourage you to leave comments and suggest improvements. Your feedback is invaluable and helps us continually enhance our content to better serve our audience.<\/p>\n<h2>FAQ<\/h2>\n<ol itemscope itemtype=\"https:\/\/schema.org\/FAQPage\">\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<h3 class=\"fw-bold\" itemprop=\"name\">What is OpenSSL and why is it important?<\/h3>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">OpenSSL is a robust, widely-used toolkit that provides support for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols, as well as a general-purpose cryptography library. It is essential for ensuring secure communication and data protection on your CentOS system.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<h3 class=\"fw-bold\" itemprop=\"name\">How can I install OpenSSL on CentOS?<\/h3>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can install OpenSSL on CentOS using the yum package manager with the command &#8216;sudo yum install -y openssl&#8217;. This command installs the OpenSSL package and its dependencies.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<h3 class=\"fw-bold\" itemprop=\"name\">How can I update OpenSSL to the latest version on CentOS?<\/h3>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can update OpenSSL to the latest version on CentOS by first updating your system packages to their latest versions with &#8216;sudo yum update -y&#8217;. Then, you can update the OpenSSL package to the latest version available in the repositories with &#8216;sudo yum update -y openssl&#8217;.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<h3 class=\"fw-bold\" itemprop=\"name\">How can I build OpenSSL from source on CentOS?<\/h3>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">You can build OpenSSL from source on CentOS by first installing the required dependencies with &#8216;sudo yum install -y gcc make perl wget&#8217;. Then, download the OpenSSL source code from the official website, extract the source code, configure the OpenSSL build, compile and install OpenSSL, and finally update the system&#8217;s path.<\/span>\n            <\/p>\n<\/li>\n<li itemscope itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\">\n<h3 class=\"fw-bold\" itemprop=\"name\">What is the importance of maintaining an up-to-date OpenSSL installation?<\/h3>\n<p itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n                <span itemprop=\"text\">Maintaining an up-to-date OpenSSL installation is crucial as it provides you with the latest security features and patches. It plays a vital role in secure communication, data encryption, and certificate management, thus ensuring the security and stability of your CentOS environment.<\/span>\n            <\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>OpenSSL is a robust, widely-used toolkit that provides support for the Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols, as well as a general-purpose cryptography library. Installing and&#8230;<\/p>\n","protected":false},"author":6,"featured_media":13676,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,996,1019],"tags":[1244,1536,1625,1744],"class_list":["post-6133","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-linux","category-openssl","tag-centos","tag-linux","tag-openssl","tag-security"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/6133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=6133"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/6133\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/13676"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=6133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=6133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=6133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}