假设下载文件为:cmake-3.22.0-linux-x86_64.tar.gz
tar --strip-components=1 -xf cmake-3.22.0-linux-x86_64.tar.gz -C /usr/local cd /usr/local/bin ln -s cmake cmake3
[root@localhost ~]# cmake --version cmake version 3.22.0 CMake suite maintained and supported by Kitware (kitware.com/cmake).