Skip to content

libssl.so.1.1 missing on Ubuntu

Problem

After upgrading to Ubuntu 22.04 LTS, many users experience errors when applications try to load libssl.so.1.1, with error messages similar to:

ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory

This occurs because Ubuntu 22.04 switched from OpenSSL 1.1.x to OpenSSL 3.0.x, which uses different library names and paths. Applications built against the older OpenSSL version cannot find the required libraries.

IMPORTANT

OpenSSL 1.1.1 reached its End-of-Life (EOL) on September 11, 2023, and no longer receives security updates. Migrating to OpenSSL 3.x should be your long-term solution.

Solutions

The simplest approach is to install the official Ubuntu package. This method ensures compatibility and ease of maintenance.

bash
sudo apt update
sudo apt install libssl1.1

If the package isn't available in the main repositories, you can add the focal-security repository:

bash
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list
sudo apt update
sudo apt install libssl1.1

Method 2: Manual download and installation

If the repository method doesn't work, you can manually download and install the package:

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

TIP

Check the Ubuntu package repository for the latest version if this specific URL is outdated:

http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/

Method 3: Recompile affected applications

For Python environments managed with tools like pyenv or asdf, reinstall the Python versions to rebuild them against the new OpenSSL libraries:

bash
# For pyenv users
pyenv uninstall 3.9.10
pyenv install 3.9.12

# For asdf users
asdf uninstall python 3.10.12
asdf install python 3.10.12

Method 4: Local OpenSSL installation (Advanced)

For situations where you cannot install system-wide libraries, build OpenSSL 1.1.x locally:

bash
mkdir -p $HOME/opt
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"
make
make test
make install

Then add the libraries to your library path:

bash
export LD_LIBRARY_PATH=$HOME/opt/openssl/lib:$LD_LIBRARY_PATH

You can add this line to your ~/.bashrc or ~/.profile for persistence.

WARNING

Manually compiling and installing OpenSSL system-wide (using make install without a custom prefix) can interfere with the system's package manager and cause dependency issues.

Verifying the solution

After implementing any solution, verify that the libraries are accessible:

bash
ldconfig -p | grep libssl.so.1.1

Or check if your application can find the library:

bash
ldd /path/to/your/application | grep libssl

Long-term recommendation

While the above solutions address the immediate compatibility issue, you should plan to:

  1. Update your applications to support OpenSSL 3.x
  2. Rebuild any custom software against the new OpenSSL version
  3. Monitor for security updates for both OpenSSL 1.1.x (if you keep it) and 3.x

INFO

Many language package managers (like Poetry) have released updates that are compatible with OpenSSL 3.x. Updating these tools may resolve the issue without requiring the OpenSSL 1.1.x library.

Conclusion

The libssl.so.1.1 missing error on Ubuntu 22.04 is a common compatibility issue caused by the OpenSSL version upgrade. While installing the legacy library provides an immediate fix, migrating your applications to support OpenSSL 3.x should be your ultimate goal for security and maintainability.