删除旧的cmake
# sudo apt remove cmake
# sudo apt purge --auto-remove cmake
hash -r
运行 sudo ./cmake-3.17.3-Linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr/local
sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
也可以使用apt安装
1 安装下列软件包
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget
2 安装sign key
wget -qO - |
sudo apt-key add -
3 添加源
ubuntu 16
sudo apt-add-repository 'deb xenial main'
sudo apt-get update
ubuntu 18
sudo apt-add-repository 'deb bionic main'
sudo apt-get update
4 然后运行
sudo apt-get install cmake
阅读(2401) | 评论(0) | 转发(0) |