Install the latest version of CMake under Ubuntu 16.04

created at 07-27-2021 views: 189

The current latest version of CMake is 3.15.3.. Update cmake to the latest version in Ubuntu, the process is as follows:
1. Uninstall the old version of CMake that has been installed [not required]

apt-get autoremove cmake

2. File download and decompression:

wget https://cmake.org/files/v3.9/cmake-3.15.3-Linux-x86_64.tar.gz

Unzip:

tar zxvf cmake-3.15.3-Linux-x86_64.tar.gz

View the unzipped directory:

tree -L 2 cmake-3.15.3-Linux-x86_64
cmake-3.15.3-Linux-x86_64
├── bin
│   ├── ccmake
│   ├── cmake
│   ├── cmake-gui
│   ├── cpack
│   └── ctest
├── doc
│   └── cmake
├── man
│   ├── man1
│   └── man7
└── share
    ├── aclocal
    ├── applications
    ├── cmake-3.9
    ├── icons
    └── mime

12 directories, 5 files

There are various product programs of the cmake family under bin.
3. Create a soft link
Note: The file path can be specified, generally choose /opt or /usr path, here choose /opt
mv cmake-3.15.3-Linux-x86_64 /opt/cmake-3.15.3

mv cmake-3.15.3-Linux-x86_64 /opt/cmake-3.15.3
ln -sf /opt/cmake-3.15.3/bin/*  /usr/bin/ 

Then execute the command to check:

>>>cmake --version
cmake version 3.15.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
>>>
>>>cmake-gui

cmake in ubuntu

OK. Now the latest version of cmake is successfully installed.

created at:07-27-2021
edited at: 07-27-2021: