How to upgrade cmake in Ubuntu
Warning -- Do not do step 2 if you have Robot Operating System (ROS) installed
- Check your current version with
cmake --version
- Uninstall it with
sudo apt remove cmake
- Visit https://cmake.org/download/ and download the latest binaries
- In my case
cmake-3.6.2-Linux-x86_64.sh
is sufficient copy the binary to /opt/
- In my case
chmod +x /opt/cmake-3.*your_version*.sh
(chmod makes the script executable)sudo bash /opt/cmake-3.*your_version.sh*
(you'll need to pressy
twice)The script installs to
/opt/cmake-3.*your_version*
so in order to get thecmake
command, make a symbolic link:sudo ln -s /opt/cmake-3.*your_version*/bin/* /usr/local/bin
Test your results with
cmake --version
In the new version of cmake (ex: 3.9.6), to install, download tar file from https://cmake.org/download/. Extract the downloaded tar file and then:
cd $CMAKE_DOWNLOAD_PATH
./configure
make
sudo make install
I would like to follow your advice Wolf, but the script don't install the prog. So i just creat the folder but doesn't show like installed when i do
cmake --version
I find a other way peraps more easy :
sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo -E apt-get update
sudo apt-get install cmake