1. Do not delete the previously installed Cmake and download the new version of Cmake.
Download address of Cmake official website
2. Unzip the software package
# cmake可执行性文件
/home/yoyo/360Downloads/cmake-3.21.1-linux-x86_64/bin/cmake
# cmake-gui界面
/home/yoyo/360Downloads/cmake-3.21.1-linux-x86_64/bin/cmake-gui
3. Configure environment variables
gedit ~/.bashrc
# 添加内容,PATH路径根据真实路径
export PATH=/home/yoyo/360Downloads/cmake-3.21.1-linux-x86_64/bin:$PATH
# 更新bashrc
source ~/.bashrc
4. Check whether the installation is successful
cmake --version