18

So i first encountered this problem when i tried to run nodejs on my system. And i got this error message

node: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

I also encountered it when i tried to run virtualBox and it gave me same think like: "we can't start because we do not have libcrypto.so.1.1" I also tried to search a solution for it but i couldn't find any that would work for me. Btw i use arch as my operating system and everything i find about anything was for ubuntu.

Komiš
  • 181
  • 1
  • 1
  • 3

6 Answers6

25

i also ran into this on arch. The solution for me was to also install openssl-1.1 which provides libcrypto.so.1.1.

The upgrade may have also broke pacman for you; if so, you will have to download the package from a mirror and manually place libcrypto.so.1.1 and libssl.so.1.1 into /usr/lib/. Then, you can run

pacman -U --overwrite '/usr/lib/*' openssl-1.1-1.1.1.s-2-x86_64.pkg.tar.zst

to install the full package.

Note that sudo may also be broken if pacman is, so if you don't have a root password to log in via su you may need to recover from an install disk.

skwerlman
  • 351
  • 2
  • 4
  • 1
    This was very helpful. `scp` was not working either, so I had to copy the `.so` files using `nc`. – Lenar Hoyt Nov 06 '22 at 22:32
  • Happened to me right now on Arcolinux, with pacman beyond repair. Unable to do this thing you suggested, so unfortunately I'm reinstalling the system. – Sebastian Nov 07 '22 at 19:21
  • you should be able to use the installer to chroot into your system and install openssl-1.1 that way, so you dont need to fully reinstall – skwerlman Nov 07 '22 at 23:12
  • 3
    Cannot use pacman to install openssl unless openssl is installed. So I did a dirty workaround: `mkdir openssl-1.1; tar xf openssl-1.1-1.1.1.s-2-x86_64.pkg.tar.zst -C openssl-1.1; cd openssl-1.1; sudo cp -vr usr/* /usr`. Then overwrite with a wider pattern `sudo pacman -U --overwrite \* openssl-1.1-1.1.1.s-2-x86_64.pkg.tar.zst` – Mikolasan Nov 14 '22 at 19:11
  • 4
    I just had the same problem, indeed `sudo` was also not working. I remembered that I had Docker installed, which on noob way always runs as root, which has now been my way out. I ran arch docker image; `docker run --rm -it -v /usr/lib:/temp archlinux` and in the container ran `pacman -Sy openssl-1.1` and moved the files `mv /usr/lib/libcrypto.so.1.1 /usr/lib/llibcrypto.so /usr/lib/libssl.so.1.1 /usr/lib/libssl.so /temp/` – Rikels Nov 15 '22 at 23:18
  • the docker workaround is interesting! thanks @Rikels – skwerlman Feb 23 '23 at 09:43
  • A partial package upgrade will most likely lead into this situation, especially when the system hasn't been upgraded for a bit (months). The problem is, e.g. (upgrading `linux`, `systemd`, `glibc` will uprade `openssl` to 3.x removing openssl 1.1 which causes the issue). The workaround is as explained by @skwerlman manually download the package and extract it in a `chroot` env with network access, place the 2 files in `/usr/lib/` to make `pacman` runnable again, should be easy from this point. – Terry Wang Mar 13 '23 at 06:30
2
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 476.9G  0 disk
├─sda1   8:1    0   512M  0 part
├─sda2   8:2    0     1G  0 part
├─sda3   8:3    0  29.3G  0 part
├─sda4   8:4    0  75.1G  0 part 
└─sda5   8:5    0   371G  0 part
sdb      8:16   0 596.2G  0 disk
├─sdb1   8:17   0 146.6G  0 part
├─sdb2   8:18   0     1K  0 part
├─sdb5   8:21   0 248.9G  0 part
└─sdb6   8:22   0 200.7G  0 part
sdc      8:32   1  28.7G  0 disk
├─sdc1   8:33   1  28.6G  0 part
└─sdc2   8:34   1    32M  0 part

for those get kernel panic and can't use terminal using pacman:

  • use live CD/USB and boot it
  • run lsblk command and mount / and /boot as I explain (see picture)
  • in this case I know my / is sda3 and my boot is sda1 so
  • run mount /dev/sda3 /mnt and mount /dev/sda1 /mnt/boot/efi
  • then do arch-chroot /mnt and run pacman -Syu
  • if you got error so you can try this command: pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg --config /mnt/etc/pacman.conf -Syu

Thanks to Richard and other guys from Arch Telegram group

GameO7er
  • 143
  • 6
  • 2
    Please [don't post images of text](https://unix.meta.stackexchange.com/questions/4086/psa-please-dont-post-images-of-text). – doneal24 Nov 27 '22 at 20:25
  • thank you so much. I will replace it with text when I go home. I don't have access to code now – GameO7er Nov 28 '22 at 07:04
1

I made the mistake of interrupting an upgrade and had the problem with that library missing. I had to download pacman-static so I could upgrade packages because pacman was wanting the old verison of libcrypto, but openssl was already upgraded to version 3. I was also having key problems so I ended up installing openssl-1.1 to fix the libcrypto errors and archlinux-keyring to fix the key problems. Afterwards, I used yay to install pacman-static from the Arch User Repository so I would make sure that I have an up to date version instead of someone else's copy.

Lee
  • 116
  • 1
  • 7
  • 1
    pacman-static is a nice an simple solution. Used with a live linux usb key it will remove most of the difficulty. – Pierrot Jul 31 '23 at 19:09
0

I came across the same issue, however sudo was also broken and I couldn't do anything from current installation, as skwerlman mentioned. So I boot my USB installer and run:

sudo pacman -Sy --overwrite '/usr/lib/*' openssl-1.1

This fixed the issue. Thanks skwerlman.

spasoye
  • 11
  • 1
  • While that's a potentially helpful way to solve the issue, I suggest to not generalize solutions obtained on misconfigured systems (you state that your "sudo was broken"). – jstarek Nov 22 '22 at 20:15
0

I do not get what all the other answers are trying to get at.

On my RHEL 7.9 I have this

ls -l /lib/libcrypto*

lrwxrwxrwx. 1 root root      19 Apr 19  2022 libcrypto.so -> libcrypto.so.1.0.2k
-rwxr-xr-x. 1 root root 1440264 Mar  4  2016 libcrypto.so.0.9.8e
lrwxrwxrwx. 1 root root      19 Apr 19  2022 libcrypto.so.10 -> libcrypto.so.1.0                                             .2k
-rwxr-xr-x. 1 root root 2520920 Mar 23  2022 libcrypto.so.1.0.2k
lrwxrwxrwx. 1 root root      19 Jun 11  2021 libcrypto.so.6 -> libcrypto.so.0.9.8e

when you see an error such as error while loading shared libraries: libcrypto.so.1.1 and you have that library installed but the specific file (or link) of .so.1.1 is not present, but you notice the other numbers like I show above, then you can just make a link like so...

in your case the library at hand is libcrypto.so and as you can see I have that which is a link to the appropriate versioned .so file based on whatever OpenSSL version I have installed which provides that rpm. And as that gets updated over time, what libcrypto.so points to will be altered accordingly.

But what you want to do is create a libcrypto.so.1.1 link and point it to libcrypto.so

you do that via running this command in that folder where the .so file is located

ln -s libcrypto.so libcrypto.so.1.1

That way whatever software you're using which is specifically coded (wrongly in my opinion) to reference a specific .so version (.so.1.1 in your case) you make it happy and able to run. When the newer version of OpenSSL (or whatever) does not work with whatever code you are using you'll find out otherwise this works 99% of the time and will get you past your shared library not found error.

ron
  • 5,749
  • 7
  • 48
  • 84
  • 1
    the issue is specific to a packaging change on arch linux, so it makes sense that you would not see it on RHEL – skwerlman Feb 23 '23 at 09:42
-2

I am using Garuda Linux, a version of Arch, same thing happened to me just now after a sizeable update, pacman, cp, ls, sudo all came up with the same message about the missing libcrypto file. I'm not sure why but it was as simple as logging in as root su - root and entering my normal sudo password and bingo...

I could now use pacman to install openssl-1.1. After logging out from root back into normal user... Everything was working again. Thanks for the help above guys!

Fco Javier Balón
  • 1,144
  • 2
  • 11
  • 31
Johnno
  • 1