去官网下载所需版本:https://cmake.org/download/
之后解压
安装
cd cmake-x.xx.xx
./bootstrap
DESTDIR=path make install make
bashrc中添加
export PATH="path/bin:$PATH"
查看是否安装成功
source ~/.bashrc
cmake --version
安装成功
参考:https://blog.csdn.net/wteruiycbqqvwt/article/details/90812498