问题
CMake 3.8.2 or higher is required. You are running version 3.5.1
方案1 卸载重装
1.卸载之前系统中cmake
sudo apt remove --purge cmake
hash -r
2.安装build-essential
sudo apt-get install build-essential
3.获取cmake
wget http://www.cmake.org/files/v3.8/cmake-3.8.2.tar.gz
4.解压与安装
tar xf cmake-3.8.2.tar.gz
cd cmake-3.8.2
./configure
make
sudo make install
5.查看版本
cmake --version
6.成功安装cmake后,如果出现-bash: /usr/bin/cmake: No such file or directory
,则可以手动添加,找到安装的cmake文件,进入cmake3.x文件夹中,在进入bin文件夹,运行:
cp ./cmake-3.x/bin/cmake /usr/bin/
方案2 通过软链接
# 下载
wget https://cmake.org/files/v3.x/cmake-3.x-Linux-x86_64.tar.gz
tar -xzvf cmake-3.x-Linux-x86_64.tar.gz
# 解压出来的包,将其放在 /opt 目录下,其他目录也可以
sudo mv cmake-3.x-Linux-x86_64 /opt/cmake-3.x
# 建立软链接
sudo ln -sf /opt/cmake-3.x/bin/* /usr/bin/
# 查看 cmake 版本
cmake --version