ubuntu: upgrading software (cmake) - version disambiguation (local compile) [closed]

人走茶凉 提交于 2019-12-23 19:45:37

问题


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.


回答1:


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:

apt-get remove cmake

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.




回答2:


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



来源:https://stackoverflow.com/questions/14519841/ubuntu-upgrading-software-cmake-version-disambiguation-local-compile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!