Ubuntu upgrade cmake version

Note: Do not execute the following command, this will uninstall all the packages compiled with cmake, including ros.

sudo apt-get autoremove cmake

The simpler method is to download the cmake compressed package, directly establish a soft link to overwrite the system's cmake, compressed package URL: https://cmake.org/files/

Take version 3.23.0 as an example:


tar -xzvf cmake-3.23.0-Linux-x86_64.tar.gz
sudo mv cmake-3.23.0-Linux-x86_64 /opt/cmake-3.23.0
sudo ln -sf /opt/cmake-3.23.0/bin/*  /usr/bin/

If you want to switch back to a lower version, just do a soft link again.

fff@ubuntu:~$ cmake --version    //查看cmake版本
cmake version 3.23.0

after replacement

fff@ubuntu:~$ cd /bin
fff@ubuntu:/bin$ ls -al cmake
lrwxrwxrwx 1 root root 40 12月  6 09:15 cmake -> /opt/cmake-3.23.0-linux-x86_64/bin/cmake
fff@ubuntu:/bin$ 

Guess you like

Origin blog.csdn.net/FLM19990626/article/details/129631927