Wednesday, January 5, 2022

[SOLVED] Error when installing Xcas on Ubuntu 18 -- Wrong version of mpfr

Issue

I would like to ask a question about an installation error that I get when trying to install the xcas software in Ubuntu 18.04. Although I managed to install the software via other methods than those described below in this post, I still would like to ask some questions about the error and related topics.

So, in the downloads section for Linux debian/ubuntu in xcas's webpage, it says

Other: Type the command sudo add-apt-repository "deb http://www-fourier.univ-grenoble-alpes.fr/~parisse/debian/ stable main". [...] Then run sudo apt-get update. Now you can install or upgrade by running sudo apt-get install giac python-giacpy.

I followed the instructions and I get this error from apt-get:

The following packages have unmet dependencies.
 giac : Depends: libmpfr4 (>= 3.1.0) but it is not installable

Funnily enough, I have mpfr installed and up-to-date: I can print mpfr's version with a C++ program that contains the line

cout << MPFR_VERSION_STRING << endl;

and the output is 4.0.1.

Since I have a version of mpfr that is newer than 3.1.0, I should not get that error, right? So, why do I get this error? Could there be something wrong with the installation of packages in my system? Maybe mpfr was not installed correctly? (it was installed from sources, following the instructions provided by the developers).

Thank you.


Solution

If you installed libmpfr4 from source, Apt and dpkg have no idea that it's installed, let alone which version.

A common hack is to use equivs to build a local pseudo-package to nominally satisfy a dependency which you have fulfilled by other means.

Of course, another way to solve this is to actually build a proper Debian package from the sources, and then install that. Just take care to use a version number which properly identifies your build as a local fork.



Answered By - tripleee