ubuntu 16.0.4 安装 cmake 3.17.2

参考:https://blog.csdn.net/king_700/article/details/105752062

0.如果系统有cmake,版本过低,先卸载

sudo apt remove cmake

1.先在官网(https://cmake.org/download/)下载cmake源代码cmake-3.17.2.tar.gz,注意是linux版的,别下错了 

2.解压

tar -xzf cmake-3.17.2.tar.gz

3.先安装依赖

sduo apt-get install build-essential libssl-dev

4.现在开始编译

cd cmake-3.17.2

./boostrap

make -j8

sudo make install

5.添加环境变量

vim ~/.bashrc

export PATH=/home/sick/Downloads/cmake-3.17.2/bin:$PATH

source ~/.bashrc

cmake --version

你可能感兴趣的:(Ubuntu)