I had cmake 2.8.0 installed on my machine (from ubuntu packages), the binary was placed in /usr/bin/cmake. I need to upgrade cmake version to at least 2.8.2. The ubuntu version is quite old, but I can't upgrade it right now, therefore I have to install it from sources. I've downloaded cmake 2.8.2, followed instructions, and made make install
with root privileges. Now I've got two parallel cmakes installed on my machine:
- /usr/bin/cmake - 2.8.0
- /usr/local/bin/cmake - 2.8.2
any_user@machine $ cmake --version 2.8.0 root@machine $ cmake --version 2.8.2
What should I do to get rid of 2.8.0 (which is obsolete for me right now) or just to replace 2.8.0 with 2.8.2? I would like any non-user to type cmake
(without specifying the path) to get newer version. Thanks in advance.
Normally one uses these steps (basically for any custom build application):
First, check if the newly build cmake seems to be working, by using it from its build location.
When you confirmed it is working, you properly remove the Ubuntu version using:
Finally, install the newer cmake using the
make install
command.In our case, as you already installed the custom build version, you might want to reinstall cmake again after removing the Ubuntu package, to prevent cmake being broken due to the removing process.
You should use checkinstall to install your package. It creates a package you can install on your system. This way the files you install are handled by the package manager and can be removed easily.
I think the old package will be removed automatically, when you give the package you create a newer version (I'm not sure here).