Installing the latest CMake on Ubuntu
Install a recent CMake on Ubuntu from Snap or by building a release from source.
1 min read
Updated
The CMake packaged by older Ubuntu releases is often too old for modern projects. This snippet offers two options: install the Snap package, or download and build a specific release from source. The commands are below.
Article: https://graspingtech.com/upgrade-cmake/
install.sh
bash
# Option 1: Use Snappy
sudo snap install cmake --classic
# Option 2: Install from source
sudo apt install build-essential libssl-dev
wget https://github.com/Kitware/CMake/releases/download/v3.16.5/cmake-3.16.5.tar.gz
tar -zxvf cmake-3.16.5.tar.gz
cd cmake-3.16.5
./bootstrap
make
sudo make install