Once you have both the cmake and the cmake3 package installed on your machine, you can use update-alternatives to switch between both packages.

Use the alternatives command to register both installations:

$ sudo alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake \
--family cmake

$ sudo alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake

After these two commands, cmake3 will be invoked by default, when you enter cmake from a bash prompt or start a bash script. The commands also take care of registering a few secondary commands like ctest which need to be switched along with cmake.

If you need to switch back to cmake 2.8 as the default, run the following command:

$ sudo alternatives --config cmake

There are 2 programs which provide 'cmake'.

  Selection    Command
-----------------------------------------------
   1           cmake (/usr/bin/cmake)
*+ 2           cmake (/usr/bin/cmake3)

Enter to keep the current selection[+], or type selection number: 1
Answer from sakra on Stack Overflow
🌐
GitHub
gist.github.com › 1duo › 38af1abd68a2c7fe5087532ab968574e
Install CMake on CentOS 7. - Gist - GitHub
try cmake3 --version · Copy link · Copy Markdown · I did all but the version is 2.8 I dont kno why dont set up · For centos, you can create shortcut to /usr/sbin/cmake using this command: ln -s /folderorfile/link/will/point/to /name/of/the/link · Copy link · Copy Markdown · I think below command also works perfectly! which is simplest way to install · yum install cmake · Copy link · Copy Markdown · Worked as expected in RHEL 7.
🌐
Xinyustudio
xinyustudio.wordpress.com › 2014 › 06 › 18 › how-to-install-cmake-3-0-on-centos-6-centos-7
How to Install CMake 3.0 on CentOS 6 / CentOS 7 – Xinyustudio
June 18, 2014 - 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 ...
🌐
Installati.one
installati.one › home › how to install cmake3 on centos 7
How To Install cmake3 on CentOS 7 | Installati.one
May 1, 2023 - In this tutorial we learn how to install cmake3 on CentOS 7 using yum and dnf.
🌐
Centos
cbs.centos.org › koji › rpminfo
cmake3-3.6.1-2.el7.x86_64.rpm | RPM Info | CentOS Community Build Service
Main Site Links: · Summary · Packages · Builds · Tasks · Build Targets · Users · Hosts · Reports · Search
Find elsewhere
🌐
Bits and Dragons
bitsanddragons.wordpress.com › 2022 › 09 › 19 › error-cmake-3-1-or-higher-is-required-you-are-running-version-on-centos-7-x
ERROR: CMake 3.1 or higher is required. You are running version … on CentOS 7.X | Bits and Dragons
September 26, 2022 - Our OS of choice, CentOS 7.9, is already quite old. It means we need newer version of the default tooks to compile some of the programs one can randomly get. One of the basic ones is, of course, CMake. I got the above message trying to compile one of my gpu monitoring tools and decided to fix it at least in one of our clients.
🌐
CMake
cmake.org › install
Resources
February 22, 2023 - Since CMake is the most downloaded software build platform, there is an overwhelming number of resources out there. We wanted to pull together some of the best resources so you can easily find what you need no matter where you are in your CMake journey.
🌐
Snapcraft
snapcraft.io › install › cmake › centos
Install CMake on CentOS using the Snap Store | Snapcraft
September 30, 2025 - Snap is available for CentOS 7.6+, and Red Hat Enterprise Linux 7.6+, from the Extra Packages for Enterprise Linux (EPEL) repository.
🌐
GitHub
gist.github.com › 1duo › 38af1abd68a2c7fe5087532ab968574e
Install CMake on CentOS 7. · GitHub
Install CMake on CentOS 7. GitHub Gist: instantly share code, notes, and snippets.
🌐
GitHub
gist.github.com › zrsmithson › 8a1b7923a8f37dcb2e6b12b7e408fd50
Installing latest cmake and git versions on Rhel/Centos, and setting it as the default commands · GitHub
A semi-updated version of cmake is available through yum, but named cmake3. At the time of writing this, cmake3 is version 3.17 and the latest is 3.18.
🌐
SourceExample
sourceexample.com › article › en › 68a27e3315ce3e52c7074e044b7969ff
Centos install the latest version of cmake
July 27, 2020 - When we are doing some applications, the compilation error is reported that the cmake version is too low. The default cmake version on Centos7 is version 2.8.11, which is a relatively low version, so we need to upgrade cmake · Official website transmission: https://cmake.org/
🌐
Bluhm-de
bluhm-de.com › home › linux › compile cmake on centos 7
Compile CMAKE on CentOS 7
There are cases, where you need a newer CMAKE version on your CentOS 7 system.
🌐
RPMfind
rpmfind.net › linux › rpm2html › search.php
RPM resource cmake
The search service can find package by either name (apache), provides(webserver), absolute file names (/usr/bin/apache), binaries (gprof) or shared libraries (libXm.so.2) in standard path. It does not support multiple arguments yet · The System and Arch are optional added filters, for example ...
🌐
RPMfind
rpmfind.net › linux › rpm2html › search.php
RPM resource cmake3
The System and Arch are optional added filters, for example System could be "redhat", "redhat-7.2", "mandrake" or "gnome", Arch could be "i386" or "src", etc.