Resolving libssl.so.1.1 Missing Issues in Ubuntu 22.04: OpenSSL Version Compatibility Solutions

Nov 23, 2025 · Programming · 17 views · 7.8

Keywords: Ubuntu 22.04 | OpenSSL | Shared Library | Python | Compatibility

Abstract: This paper provides an in-depth analysis of the libssl.so.1.1 missing problem following Ubuntu 22.04's upgrade to OpenSSL 3.0. Through system-level solutions and custom library path approaches, it elaborates on shared library dependency mechanisms and offers comprehensive troubleshooting procedures and best practices for resolving Python toolchain compatibility issues.

Problem Background and Root Cause

In Ubuntu 22.04 LTS, the system's default OpenSSL library was upgraded from the 1.1.x series to version 3.0.x. This significant change has caused compatibility issues for numerous applications that depend on the older OpenSSL version. The specific manifestation is the inability to locate the libssl.so.1.1 shared library file during runtime, resulting in the error: ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory.

System-Level Solution

The most direct and effective solution is to install the compatible libssl1.1 package. The Ubuntu official repository still provides version 1.1 library files compatible with 22.04, which can be installed using the following commands:

wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb

The advantages of this approach include:

Custom Library Path Approach

As an alternative solution, developers can choose to manually compile OpenSSL 1.1.x and control library loading paths through environment variables:

mkdir -p $HOME/opt/lib
cd $HOME/opt
wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
tar -zxvf openssl-1.1.1o.tar.gz
cd openssl-1.1.1o
./config --prefix=$HOME/opt/openssl-1.1.1o && make && make test
cp -r .libs/* $HOME/opt/lib/
export LD_LIBRARY_PATH=$HOME/opt/lib:$LD_LIBRARY_PATH

This method is suitable for scenarios such as:

Technical Principle Deep Analysis

The dynamic linking mechanism for shared libraries in Linux systems is implemented through ld.so. When an application runs, the dynamic linker searches for shared libraries in the following order:

  1. Paths specified by the LD_LIBRARY_PATH environment variable
  2. Library paths cached in /etc/ld.so.cache
  3. Default system library paths (/lib, /usr/lib)

OpenSSL 3.0 introduces API incompatibility. Although it provides a compatibility layer, some applications still require specific 1.1.x version symbols. The major version number change in .so.1.1 indicates ABI incompatibility, which is the fundamental cause of linking failures.

Impact on Python Virtual Environments

Library dependencies can become more complex in Python virtual environments. While virtual environments create isolated Python interpreters and library paths, system-level shared library dependencies still persist. When using virtualenv or venv to create environments:

import ssl
print(ssl.OPENSSL_VERSION)

This code displays the OpenSSL version linked by the current Python interpreter. If the virtual environment was created on an older system, upgrading the system may require recreating the virtual environment or installing compatible libraries.

Best Practice Recommendations

For different usage scenarios, the following solutions are recommended:

Troubleshooting Procedure

When encountering shared library issues, follow these diagnostic steps:

  1. Use ldd command to check application library dependencies: ldd /path/to/application
  2. Verify library file existence: find / -name libssl.so.1.1 2>/dev/null
  3. Check current library loading paths: echo $LD_LIBRARY_PATH
  4. Examine system library cache: ldconfig -p | grep libssl

Long-term Compatibility Considerations

As OpenSSL 3.0 becomes mainstream, developers are advised to:

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.