1

I have done alot of searching and can't figure out how to fix my ubuntu installation.

I have a dual boot system with windows 7 (I can boot into windows fine). When I try to boot ubuntu from grub as per usual, it now goes into kernel panic complaining

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

This happened a while back and I haven't got around to fixing it until now. I can't remember what caused this (I assume a failed update). I can't use recovery mode as it gives the same issue nor any of the older kernels still installed.

I have tried booting into text mode or single mode, but it always fails the same way with the above error.

I have tried booting via a live usb stick and have managed to mount the root directories and chroot into them. However I can't do a

sudo apt-get update ; sudo apt-get upgrade

due to the same issue. Even trying to do ls in a directory fails with the above error.

I would really appreciate any advice on how to get the ubuntu up and running again.


I have tried copying the libpcre.so.3.13.1 from the live cd to the /lib/x86_64-linux-gnu/ on the harddisk, and then linked it in the same folder to libpcre.so.3. Unfortuately that didn't work either. I can't find any useful log of the failed boot to share to help with the debugging.

Please let me know if there is any additional information I can provide to help debug the issue.

  • Does sudo ldconfig help? – Karl Richter Oct 14 '15 at 10:57
  • Thanks for the suggestion, but unfortunately it gives the same shared library error – Swifty Oct 14 '15 at 11:19
  • fisrt thing to do is to verify if the .so exist, the file should be in /lib/x86_64-linux-gnu/ directory or you can use find utils to find the file. Follow this guide to restore and check your ld path. GUIDE – Aizuddin Zali Oct 14 '15 at 11:33
  • I have found the library in /lib/i386-linux-gnu/libpcre.so.3 I made a link of it back to /lib/ I then tried sudo ldconfig, but it still doesn't work. I however get a different error message root@ubuntu:/lib/x86_64-linux-gnu# sudo ldconfig sudo: error while loading shared libraries: libpcre.so.3: wrong ELF class: ELFCLASS32 I'm guessing I have the 32bit version installed and that is screwing up the 64bit operating system – Swifty Oct 14 '15 at 12:13
  • Remove the link of /lib/i386-linux-gnu/libpcre.so.3 in /lib. After that boot into your live system, download mirrors.kernel.org/ubuntu/pool/main/p/pcre3/… and extract the file via dpkg -x libpcre3_8.31-2ubuntu2.1_amd64.deb foo and copy the content of foo into your / of your system. – A.B. Oct 14 '15 at 18:26
0

You said

Thank you A.B. That has fixed it!

Therefore I have converted my comment into an answer:

  1. Remove the link of /lib/i386-linux-gnu/libpcre.so.3 in /lib

  2. Boot into your live system

  3. Download and extract

    wget http://mirrors.kernel.org/ubuntu/pool/main/p/pcre3/libpcre3_8.31-2ubuntu2.1_amd64.deb
    dpkg -x libpcre3_8.31-2ubuntu2.1_amd64.deb foo
    
  4. Mount your root partition of your real system

  5. Copy the content of foo into / of your real system

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.