How to install the latest version of Cmake via command line.

Build, Test, and package your software with Cmake !
CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.

Well, we can install it by following these simple steps:

  1. Uninstall the default version provided by Ubuntu’s package manager:
    sudo apt-get purge cmake
    
  2. Go to the official CMake webpage, then download and extract the latest version. Update the version and build variables in the following command to get the desired version:
    version=3.x
    build=3
    mkdir ~/temp
    cd ~/temp
    wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
    tar -xzvf cmake-$version.$build.tar.gz
    cd cmake-$version.$build/
    
  3. Install the extracted source by running:
    ./bootstrap
    make -j4
    sudo make install
    
  4. Test your new cmake version.
    $ cmake --version
    

    Results of cmake --version:

    cmake version 3.10.X

Here,

In 3.10.X the X represents the last part of the version that we defined as build. The build may change if cmake is updated. Just for example given below:-

    version=3.10
    build=7

That’s it.

Akash Angle

I am a Full time Linux user who has quit using Windows for unknown reasons, making my life truly open source.

Recent Posts

Get the most juice from your ISP/router — setting MTU size & other handy tweaks

This is not an ad-vocation by any means for TP-link branding, however a real life…

6 months ago

How to make any Android phone up-to 3x faster – Developer options unleashed

First of all we need to hit the kernel version on any Android device. You…

6 months ago

systemd-resolve command not found in Ubuntu Desktop

Use resolvectl status instead. It's like something deprecates and suddenly things get broken! In systemd…

11 months ago

How to exclude multiple directories with rsync?

Geeky question: This is what people and friends have tried: rsync -arv --exclude "/home/john/.ccache:/home/ben/build" /home/john…

11 months ago

How to resolve apt-get -f not working

You might encounter this error which appears to be very common on Debian based Distro's…

11 months ago

How to install Broadcom STA wireless drivers on Kali Linux

PS: This article is for only Kali Linux users, that too having a Broadcom Wireless…

12 months ago