error while loading shared libraries: libssl.so.1.1 (and libcrypto.so.1.1)
Solved.
Problem is that if you install non-Ubuntu version of openssl (unpatched) you get the "error while loading shared libraries" error, because this is something that was added by Ubuntu devs to their distribution (and I still don't know why and makes no sense and makes lots of trouble). Source: https://askubuntu.com/a/830532/676863
So, mostly you will run into this if you compiled an official version from https://www.openssl.org/source/ e.g. the openssl-1.0.2m.tar.gz version. While official Ubuntu patched (million times according to the guys at #ubuntu on Freenode) version is still openssl-1.0.2g and is the one you want to patch, compile and install to make it working.
Solution (edited from https://stackoverflow.com/a/22634441/3108268):
- I used this build https://launchpad.net/ubuntu/+source/openssl/1.0.2g-1ubuntu13 because it was most up-to-date.
-
wget https://launchpad.net/ubuntu/+archive/primary/+files/openssl_1.0.2g.orig.tar.gz
(might need to add--no-check-certificate
) tar -xvf openssl_1.0.2g.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/openssl_1.0.2g-1ubuntu13.debian.tar.xz
-
tar -xvf openssl_1.0.2g-1ubuntu13.debian.tar.xz
andmv debian openssl_1.0.2g-1ubuntu13
-
whereis openssl
locate current openssl and delete/remove/backup it. -
cd openssl_1.0.2g/
andpatch -p1 < ../openssl_1.0.2g-1ubuntu13/patches/version-script.patch
-
make clean
and./config shared --prefix=/usr/local --openssldir=/usr/local/ssl -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)'
(or maybe you just need plain.config
, doesn't work for me) -
make
andmake test
andmake install
openssl version
I also needed to reboot
to be able to connect back in via SSH. All these commands were executed via web console on a cloud server. Downloaded file directory names might be different, I didn't check, so do ls -l
.
Related videos on Youtube
user3108268
Updated on September 18, 2022Comments
-
user3108268 over 1 year
As you can see I'm missing libcrypto and libssl files. I locked out myself from my server after running apt-update and apt-upgrade, I'm running this from web console, because ssh nor any other program won't work because of missing SSL files.
I tried removing and installing
apt install openssl
so didlibssl-dev
and/or compiling own openssl from a distro. None of these create the needed .so files, I ranlocate
, those files are not present anywhere on the server.There's also libssl1.0.0 which cannot be reinstalled and removing it would cause removal of 700MB of packages that would literally kill server and delete all data.
-
fkraiem over 4 yearsPlease, people, DO NOT DO THIS unless you know exactly what you are doing (and if you are reading this, you probably don't). Additionally, consider downvoting.
-
user3108268 over 4 yearsDo not do this why?