cannot open libmpfr.so.4 after update on ubuntu 18.04
Asked Answered
P

2

7

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?

Postlude answered 11/7, 2018 at 14:46 Comment(5)
You should ask this to the Ask Ubuntu community. They'll have better answers for you.Brouwer
what do you see with this command - ldconfig -p | grep mpfrPlutocrat
@Plutocrat libmpfr.so.6 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libmpfr.so.6 libmpfr.so.4 (libc6) => /usr/lib/i386-linux-gnu/libmpfr.so.4 libmpfr.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libmpfr.soPostlude
@Postlude that means it is there, look into the dmesg message about libmpfrPlutocrat
Why do I still get the error message then?Postlude
T
21

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.

Trajectory answered 2/8, 2018 at 15:39 Comment(3)
Absolutely brilliant.Naamana
Great. Thank youHeterodoxy
It should be noted that libmpfr-dev package should be installed before like sudo apt install libmpfr-dev and the path depends on your $LD_LIBRARY_PATH, you can find via ldconfig -v command and another linking can be for example: sudo ln -s /lib/x86_64-linux-gnu/libmpfr.so.6 /lib/x86_64-linux-gnu/libmpfr.so.4Zodiac
R
2

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).

Reorientation answered 12/7, 2018 at 14:14 Comment(1)
I confirm there are no conflicts, package "libmpfr4" can be installed from: packages.debian.org/stretch/libmpfr4Dietsche

© 2022 - 2024 — McMap. All rights reserved.