linux升级cmake

原文:https://blog.csdn.net/TwT520Ly/article/details/80496351
(仅仅是在我个人电脑上安装通过的例子,帖子只是个人笔记)

1.查看cmake版本

cmake --version

2 卸载过去的版本

sudo apt-get autoremove cmake

最好卸载,不然可能会出现如下错误:

CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/share/cmake-3.5
CMake Error: Error executing cmake::LoadCache(). Aborting.

3.安装需要的版本

  1. 下载
cd ~
wget https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz
tar xvf cmake-3.13.2.tar.gz
cd cmake-3.13.2

2.安装

./bootstrap --prefix=/usr
 make
 sudo make install

3.检查

cmake --version

你可能感兴趣的:(ubuntu下安装包安装)