不卸载ros升级cmake方法

由于Ubuntu默认安装cmake2.8,而源安装cmake3.10.3要求cmake最低版本为3.1(CMakeLists.txt有说明),所以我们先把cmake升级到3.2方案如下: 
第一步:使用ppa升级cmake至3.2.2 
sudo apt-get install software-properties-common 
sudo add-apt-repository ppa:george-edison55/cmake-3.x 
sudo apt-get update 
sudo apt-get upgrade 
//查看最终版本: 
cmake --version 
这时可能会有如下的报错: 
CMake Error: Could not find CMAKE_ROOT !!! 
CMake has most likely not been installed correctly. 
Modules directory not found in 
/usr/lib 
网上提供的方案是先卸载cmake-data,然后再次重新安装:https://blog.csdn.net/lixiaogang_theanswer/article/details/73693004,但是这样会顺带卸掉一些ROS包,显然是不可取的,我们直接安装cmake,然后查看版本: 
sudo apt-get install cmake 
cmake --version 
发现此时已经升级到3.2.2啦 

你可能感兴趣的:(linux)