Ubuntu 20.04通过apt安装的cmake版本是3.16.3,默认安装到/usr/bin/cmake路径。
$ cmake
Command 'cmake' not found, but can be installed with:
sudo snap install cmake # version 3.29.3, or
sudo apt install cmake # version 3.16.3-1ubuntu1.20.04.1
See 'snap info cmake' for additional versions.
如果想安装其他版本,比如v3.22.6,可以到cmake的历史版本网页中下载。