升级Cmake(不用卸载原有的版本)
1、下载需要的版本
https://cmake.org/download/
2、解压、编译并安装到制定目录,修改环境变量
tar -zxvf cmake-3.20.0-rc1.tar.gz cd cmake-3.20.0-rc1 ./bootstrap --prefix=/opt/cmake-install make make install sudo gedit ~/.bashrc #把下面两个命令加入~/.bashrc中 export PATH=/opt/cmake-install/bin:$PATH export CMAKE_PREFIX_PATH=/opt/cmake-install:$CMAKE_PREFIX_PATH #保存一下并运行 source ~/.bashrc