Ubuntu updates CMake version

Sometimes in the project, the CMake version is lower than the minimum requirement. In fact, there is no need for such high requirements, but when you cannot change the other party's code, you can only upgrade your own version. 

I tried the online method of directly updating and then installing again, but the version number did not change.

sudo apt-get update

sudo apt-get remove cmake

sudo apt-get install cmake

cmake --version

 So I could only try the source code installation method online, and it was successful.

Visit the official website  Download | CMake

The version I downloaded is

 Then put it in the Document directory under Home to decompress it, just right-click it, no need to use the tar command.

Of course, you can also use tar to decompress it.

tar -xzf ***.tar.gz [-C .] ## This does not need to display each file, remove the v parameter, and extract to this directory without -C
tar -xzvf ***.tar.gz [-C . ]

Two errors occurred in the middle because g++ and OpenSSL were not installed.

 sudo apt-get install g++

sudo apt-get install libssl-dev 

In order to avoid errors, you can physically check the installation, and then execute ./configure successfully.

 Then make was successful, but it took a while.

 Finally, just run sudo make install.

 Finally, you can see that the cmake version has been updated to the latest 3.27.


To sum it up:

./configure

make

sudo make install

cmake --version

 

Guess you like

Origin blog.csdn.net/scarlettsp/article/details/131227864