Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am a noob with linux and I use Synaptic package manager to install all the software I need. I did so also for mathgl, the library for scientific graphs.

Recently a new version appeared online, but not in the package manager. I downloaded the sources and tried to install it manually. The instructions said:

cmake .
cmake .
make install

I did exactly the same, but then I realized that I forgot some build options. I did a web search to find a way how to uninstall the library, so that I can install it with the new settings, but I did not get a clear answer. What I found out is that when it comes to uninstalling under Linux, unless the developer provided an uninstall script, you are on your own and it is not trivial.

With this in mind I just tried to install the library without removing the misconfigured one.

cmake -D enable-all=on -D enable-langall=on .
cmake -D enable-all=on -D enable-langall=on .
make install

Everything seems to be fine. My question is this: is there any chance that the consequence of my action will come back to haunt me?

I am also concerned, because the old library was not removed as well as the old headers. Another strange thing is that the old headers are in


while the new ones are in


Is there any explanation for this?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

is there any chance that the consequence of my action will come back to haunt me?

Maybe. Read on:

  • The new ("enable...:) configured libraries have overwritten the new misconfigured libraries you installed...no harm done.

  • The new libraries are installed under /usr/local because that's the default for a lot of Linux distributions, but not Ubuntu; Ubuntu puts them under /usr. The former is OK for binaries (/usr/local/bin), which Ubuntu has in its default path, and those will take precedence over any binaries installed in /usr/bin, but this is not true for libraries, because /usr/local/lib is not in the default path.

  • Any programs that use this library will continue using the older headers/version in /usr/lib, unless you specifically tell those programs to use the new ones, e.g. by prefixing them with LD_LIBRARY_PATH=... or by explicitly adding /usr/local/lib to your path. For compiling things which depend on this library, you'll need to explicitly specify the /usr/local/lib path to include the new headers.

  • To fix this:

    1. It's a good idea to remove the repo-installed version of the library, unless it has lots of dependencies, in which case leave it be (or you'd have to recompile the lot).
    2. Install checkinstall, which you can use instead of the final make install step to give you a deb file that is easy to install and uninstall.
    3. Set the correct install prefix via the -DCMAKE_INSTALL_PREFIX=/usr directive before compiling.

That should do it!

share|improve this answer

Well, the new one it is using the libs from /usr/local/lib (this is a common place for softwares installed by the user). This is actually good thing, the main ideea it is to not to corrupt the packages installed via package managers.
The location of the libs are defined usually in the Makefile. I recommend to not to touch that unless you know what you are doing. The version compiled by yourself will use the libs from /usr/local/lib, the other version installed from repo will use the standard /usr/lib location.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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