“error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory”

Hey! I tried updating the packages pcre and pcre2 on dom0 because I was trying to resolve a dependency issue when installing another package. Then I wanted to restore the original pcre and pcre2 packages so I did a “dnf downgrade”. This made the entire dom0 unusable as I get an “error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory” when trying to run commands. Not even sudo works and I get a segfault on “su -”!

Please, is there anything I can do to “undo” the error and save my system?

Are you able to boot? Do you have access to the Qubes Backup tool? Or can you perform backup from the command line? If yes, the most robust way is to backup all qubes, reinstall the system and restore the qubes to the new system.

By the way, you should not install anything in dom0 unless you really have to.

I haven’t tried restarting my system because I think it would make absolutely everything unusable. Then I would have to use my mobile device to type these messages. I can’t run qubes-backup, qubes-backup-restore or the Qube Manager. I just get Python errors and the same error about libpcre.so.1. (I was trying to install a compositor)

I can not help you.
But I had other problems with dom0, too.
So I learn to keep my appvms and my shares in other drive (SSD) linked to /var/lib/qubes/appvms… and timeshift to backup.
Now I dont care if dom0 and all other appvms has problems. It is easy to reinstall then and links everything again.

I have the latest pcre RPMs in my dom0 home directory. Shouldn’t I just be able to copy the RPM contents into the root filesystem using a chroot environment and then everything would work? I’m not sure what the exact steps are. I’m able to download and boot off a live ISO from my mobile device via USB.

What’s in sudo dnf history info?

What actions does it say were performed?

I can’t run sudo dnf history info with or without sudo because I get the same Python errors about not being able to import the name ‘sha512’. I think the error’s linked to libpcre.

Running file /lib64/libpcre.so.1 gives out /lib64/libpcre.so.1: broken symbolic link to libpcre.so.1.2.12. Using tab completion in my terminal, I can see that I have libpcre.so.1.2.9 instead. So I should be able to just ln -sf libpcre.so.1.2.9 libpcre.so.1. I think I’ll take the plunge and try it in an emergency shell.

Success. As a test, I couldn’t even reboot into Qubes without changing the symlink. After changing it, I could launch Qube Manager. But I couldn’t run xfce4-terminal because of a similar error related to libpcre2. However, I was able to use XTerm to gain root access and make a similar change for pcre2. So far, everything seems to work as it should. Thanks all. This left me wondering whether the broken symlink was caused by some bug in the OS.

Also I ran sudo ldconfig, which (I think) fixed the remaining symlink libpcreposix.so.0

2 Likes

(Made title more specific, feel free to tweak it)