删除原先的cmake:
$ sudo apt-get autoremove cmake
或者
$ sudo apt remove cmake
使本地Linux 具有编译功能:
$ sudo apt-get install build-essential
寻找cmake版本:
Download | CMakehttps://cmake.org/download/
下载源代码:
$ wget https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2.tar.gz
$ wget https://github.com/Kitware/CMake/releases/download/v3.23.2/cmake-3.23.2.tar.gz
或者老版本,新版本链接下载快很多:
$ wget http://www.cmake.org/files/v3.17/cmake-3.17.3.tar.gz
一老版本为例,3.22.2 的操作是一样的。
解压:
$ tar xf cmake-3.17.2.tar.gz
$ cd cmake-3.17.2
prepare:(ubuntu)
$ sudo apt install libssl-dev
issue:
$apt install libssl-dev
/***if error message is like this:***then, using the following command coorespondingly**************************
The following packages have unmet dependencies:
libssl-dev : Depends: libssl1.1 (= 1.1.0g-2ubuntu4) but 1.1.1-1ubuntu2.1~18.04.13 is to be installed
Recommends: libssl-doc but it is not going to be installed
*********************************************************************************/
$apt-get install libssl1.1=1.1.0g-2ubuntu4
$apt install libssl-dev
第一板斧:
//in cmake source files dir
$ ./bootstrap
第二板斧:(j16 as i9 9900k)
make -j
第三板斧:
$ sudo apt-get install checkinstall
$ sudo checkinstall
删除 cmake:
$ dpkg -r cmake
___________结束__________________________________________________________
第二个版本的第三板斧:
$ sudo make install
最后在终端输入:
$ cmake --version
显示:cmake version 3.17.3
删除cmake:
$ sudo apt remove cmake