Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot open libmpfr.so.4 after update on ubuntu 18.04

Today I updated my laptop to Ubuntu 18.04. Now I try to run a program for my bachelor thesis, but it gives me the following error message:

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

I did a bit of research, and I think libmpfr4 has been droppen in this ubuntu version. Is there any way I can solve this?

like image 559
ironmaya Avatar asked Jul 11 '18 14:07

ironmaya


2 Answers

I had the same problem and solved it by creating symbolic link:

sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4

Bear in mind that this is just workaround which might trigger other issues for your case. However, this might save you the day in cases when the problematic program is just a mean to achieve something else.

like image 116
Ridge_Forrester Avatar answered Sep 19 '22 16:09

Ridge_Forrester


When you get such an error, this means that you generally need to recompile your program.

Alternatively, you may install the old MPFR 3.x version (which corresponds to libmpfr.so.4) if available, otherwise from an earlier Ubuntu release (I do not recommend that, but if there are no conflicts from the packaging system, this could be OK; FYI, in Debian, both packages libmpfr4 and libmpfr6 are co-installable).

Note: Contrary to what has been said in the comments, libmpfr.so.4 is no longer there if you're using the 64-bit ABI (x86_64), as ldconfig -p | grep mpfr gave for this file: /usr/lib/i386-linux-gnu/libmpfr.so.4, i.e. the 32-bit version. I suspect that the upgrade removed the x86_64 one (either due to a conflict or because it was no longer needed).

like image 39
vinc17 Avatar answered Sep 18 '22 16:09

vinc17