1

I've managed to break my terminals completely and am scared to reboot. I force removed some stuff using dpkg, since I installed a .rpm which didn't work out, and accidentally removed the wrong one. I have a terminal open, but each time I type sudo I get this:

sed: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory
ls: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory

Which is kinda frustrating. I have a .deb which I need to install now (containing the correct libpcre.so's), but I've no idea if it's even possible with my current configuration to get them out.

I managed to find a few files that do still exist, which I'm hoping I can point stuff at.

josh@desktop:~/Downloads$ !122
locate libpcre.so
sed: error while loading shared libraries: libpcre.so.3: cannot open shared object file: No such file or directory
/lib/i386-linux-gnu/libpcre.so.3
/lib/i386-linux-gnu/libpcre.so.3.13.2
/lib/x86_64-linux-gnu/libpcre.so.3
/lib/x86_64-linux-gnu/libpcre.so.3.13.2

Any recommendations? I'd rather not do a clean install if possible.

1

The solution I found was to boot from the bootable USB I used to install the system, find all files whose names contain pcre. At this point, I mounted the existing installations partition to /home/user/tmp/ installed sublime text (easier to create commands to run en-mass from that), then for each file in the list (except those in the man / docs directories) ran sudo cp /path/to/current/file /home/user/mounteddirectory/path/to/current/file which copied the required files and let me boot. Boot then proceeded.

After that, I found that apt gave me some errors but at the very least it ran. I ran sudo apt update which prompted me that some stuff wasn't installed properly, so I tried the suggested sudo apt -f install which gave me an error about some links. To resolve this, I eventually copied the .deb file which sudo apt -f install dumped the name of and path to (should contain libpcre3, in this case), to cwd (user root) and ran sudo dpkg --force-all -i libpcre~~~~~.deb which fixed all the other problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.