《问》How do I install the latest version of cmake from the command line on Ubuntu?
《问》
How do I install the latest version of cmake from the command line on Ubuntu?
# uninstall current version
# https://askubuntu.com/questions/1143/how-can-i-uninstall-software
sudo apt remove cmake && sudo apt-get autoremove
# install latest version
# https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line
# https://cmake.org/download/
version=3.17 && build=2
mkdir ~/temp && cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build-Linux-x86_64.sh
ls cmake-$version.$build-Linux-x86_64.sh
sudo mkdir /opt/cmake
sudo sh cmake-$version.$build-Linux-x86_64.sh --prefix=/opt/cmake
ls /opt/cmake/cmake-$version.$build-Linux-x86_64/bin/
# sudo rm -rf /usr/bin/cmake /usr/bin/ccmake /usr/bin/cpack /usr/bin/ctest
sudo ln -s /opt/cmake/cmake-$version.$build-Linux-x86_64/bin/cmake /usr/bin/cmake
sudo ln -s /opt/cmake/cmake-$version.$build-Linux-x86_64/bin/ccmake /usr/bin/ccmake
sudo ln -s /opt/cmake/cmake-$version.$build-Linux-x86_64/bin/cpack /usr/bin/cpack
sudo ln -s /opt/cmake/cmake-$version.$build-Linux-x86_64/bin/ctest /usr/bin/ctest
# check latest version
cmake --version
Comments