linuxbashubuntucmake

How can I reinstall the latest CMake version?


I would like to install CMake the latest version in a Linux environment (Ubuntu).

I have CMake version 3.5 installed, and it is not supported by some applications. I tried to upgrade it by uninstalling the current version. But when I reinstall with sudo apt-get install cmake, I get the same version 3.5 reinstalled. How do I install the latest version with sudo apt-get install?


Solution

  • This depends on the Ubuntu OS version currently installed on your PC or Mac. If you have the following Ubuntu OS version then you have this CMake installed or that you could install and reinstall with "sudo apt-get install cmake". Even if you uninstall your version and try to reinstall later version.

    Now if you have Ubuntu 16.04 installed and you want CMake 3.10, there is an OS problem since you can only install and reinstall CMake 3.5.1. To get CMake 3.10 or any other version, you have to download and install the package from Ubuntu Packages Search. Once you find the latest version of the CMake .targz files, you have to build it yourself from the command line.