Installing CMake

2 min. read

I'll be honest: I hadn't have to use Make or CMake in ages. But sometimes you need to install some system tool that comes with a make file, and you discover that you don't have CMake installed or your version is too old and doesn't work with said make file.

So this is what I did to install it (in case I have to do it again):

  • Uninstall your current version:

sudo apt-get purge cmake
  • Go to official CMake webpage then download and extract the latest version.

mkdir ~/temp
cd ~/temp
tar xzvf cmake-3.7.2.tar.gz
cd cmake-3.7.2/
  • Install it by running:

make -j4
sudo make install
  • Test your new cmake version.

cmake --version
  • Results of cmake --version:

cmake version 3.7.2
CMake suite maintained and supported by Kitware (

Note In 3.7.X the X represent a number that may change if the app is updated. According to the official webpage the Latest Release at the moment of writing this is 3.7.2.

The make install command need root privileges. The cmake --version command only works after you open a new terminal because cmake is installed under /usr/local/bin/ by default, not /usr/bin/.

Installing gcc-6

I also had to update my gcc. Since I use Ubuntu, this is the ppa:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-6.3