ubuntu18.04 卸载和重装cmake(uninstall and install cmake)

1. 卸载 cmake

sudo apt remove --purge cmake
hash -r

2 安装 cmake

两种方法snap或者源码安装

2.1 snap

sudo snap install cmake --classic
cmake --version #cmake version 3.17.2

2.2 source code

sudo apt install build-essential libssl-dev
wget https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2.tar.gz
tar -zxvf cmake-3.17.2.tar.gz
cd cmake-3.17.2
./bootstrap
make 
sudo make install 

3. reference

参考1