Coding⏱️ 3 min read📅 2026-06-15

How to Fix: error: OpenSSL library not found. When I do have openssl installed and libssl.so located in /usr/local/lib

Error fixing OpenSSL library not found in Ubuntu 16.04 ncrack compilation.

Quick Answer: Try adding the /usr/local/lib directory to /etc/ld.so.conf and then run ldconfig.

The error 'OpenSSL library not found' occurs when attempting to compile ncrack on Ubuntu 16.04, despite having OpenSSL installed and libssl.so located in /usr/local/lib. This issue affects users who have successfully installed OpenSSL but are still encountering compilation errors.

This problem can be frustrating because it may lead to a failed build of the ncrack tool, which is used for network scanning and penetration testing. Fortunately, there are several methods to resolve this issue, and we will outline them below.

🛑 Root Causes of the Error

  • The primary reason for this error is that the system's ld library search path does not include the /usr/local/lib directory where libssl.so is located. This is because the ld configuration file (/etc/ld.so.conf) may not have been updated to include this new location.
  • Another possible cause is a mismatch between the OpenSSL version used during compilation and the version installed on the system. Although you installed OpenSSL 1.1.0h from source, it's possible that the system still uses an older version of OpenSSL.

✅ Best Solutions to Fix It

Updating ld configuration to include /usr/local/lib

  1. Step 1: Open a terminal and edit the /etc/ld.so.conf file using your preferred text editor: sudo nano /etc/ld.so.conf
  2. Step 2: Add the following line at the end of the file: /usr/local/lib
  3. Step 3: Save and close the file. Then, run the command ldconfig to update the system's ld library search path.
  4. Step 4: Verify that the new location has been added by running the command getconf LD_LIBRARY_PATH

Specifying the OpenSSL library location during compilation

  1. Step 1: Modify the configure.ac file of ncrack to specify the location of libssl.so: search_path_libssl = /usr/local/lib
  2. Step 2: Run the command ./configure --with-openssl=/usr/local to re-run the build process with the updated configuration.

🎯 Final Words

To resolve the 'OpenSSL library not found' error when compiling ncrack on Ubuntu 16.04, you can try updating your system's ld configuration to include /usr/local/lib or specify the OpenSSL library location during compilation. If you are still experiencing issues, it may be helpful to check the version of OpenSSL installed on your system and ensure that it matches the version used during compilation.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions