How to Install CMake 3.0 on CentOS 6 / CentOS 7

18 Jun

Follow the step below to install CMake 3.0 on CentOS 7:

  • Download cmake-3.0.0.tar.gz to a folder, e.g. /home/user/Downloads
  • Open a terminal and run below commands:

tar -zxvf cmake-3.0.0.tar.gz

     This will unpack the gz file to a folder cmake-3.0.0 under the Downloads folder



  • In the terminal and run below commands:

sudo gmake install

    It will take several minutes to build cmake out of source files.


But If you run the command below, you will see the cmake version is still the old 2.82 or earlier version!

cmake –version


  • Now in the terminal, type below commands

sudo mv cmake-3.0.0 /usr/local/

    This move the newly built output folder

Downloads/cmake-3.0.0/       ==>

  • Edit ~/.bashrc file, add the directory /usr/local/cmake-3.0.0/bin to the PATH variable:

gedit ~/.bashrc

    At the end of .bashrc file, add below line to add the cmake/bin folder to system path:

export PATH


  • Next, in the terminal, type below commands

cd /usr/local/cmake-3.0.0
mkdir share
cp -R /usr/local/share/cmake-3.0/ share/


This copies folder
     usr/local/share/cmake-3.0/       ==>

If you don’t do so, errors will pop up and complain that the share folder is not accessible to centOS!

Now, rerun the below command and you will succeed! 

cmake –version



Posted by on June 18, 2014 in Linux, Programming


Tags: , , , , , , ,

8 responses to “How to Install CMake 3.0 on CentOS 6 / CentOS 7

  1. Przy

    January 12, 2017 at 6:38 pm

    i did every step, correctly and still i have version ;/

  2. James Melbow

    June 2, 2017 at 5:37 am

    Hey Przy…. did you log out and back in again? You need to pick up the new .bashrc edits.

  3. Geoff

    June 21, 2017 at 10:09 am

    Works perfectly for me, thank you very much! 🙂

  4. jimbomorrison

    October 29, 2017 at 2:10 am

    Works for me (thanks!) … though warning copying/pasting the cmake -version failed because the - character was odd… writing it out tho shows the correct version.

  5. Ben Pietras

    December 8, 2017 at 11:25 pm


    sudo yum install epel-release
    sudo yum install cmake3

    sudo yum remove cmake
    sudo ln -s /usr/bin/cmake3 /usr/bin/cmake


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: