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
Install CMake on CentOS 7. ... cmake --version cmake version *.*.* CMake suite maintained and supported by Kitware (kitware.com/cmake). ... Looks like you installed to /usr/local/bin/cmake, try invoke which the full path. Your current cmake might still linked to the previous installation. ... Worked as expected in RHEL 7. Although I didn't install the default version (with yum ...
Discussions

Install dependencies cmake3
On your site in the dependencies there is cmake3 package, is this just a typo? Required packages … make: for /usr/bin/make cmake3: for /usr/bin/cmake3 … It is also in one-liner sudo yum install git cmake3 gcc-c++ gcc binutils \ libX11-devel libXpm-devel libXft-devel libXext-devel openssl-devel ... More on root-forum.cern.ch
🌐 root-forum.cern.ch
1
0
January 5, 2021
How to install ccmake or cmake-gui on CentOS7?
Specifically for cmake 3, not 2.8 More on reddit.com
🌐 r/CentOS
3
8
August 26, 2018
centos - yum installs an old version of cmake - Unix & Linux Stack Exchange
$ yum repolist | expand Loaded ... 6 - x86_64 10,246 extras CentOS-6 - Extras 7+7 updates CentOS-6 - Updates 314 repolist: 16,864 · You can query any package whether it's installed or not using yum info . $ yum info cmake Loaded plugins: fastestmirror, priorities, ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
January 8, 2014
Does anyone know how to install CMAKE 3.5 or higher in an old Cent OS 8?
That's odd. The earliest version of cmake I can find in CentOS 8.0.1905 is 3.11.4. Not sure how you got 3.3.2 in your system. Could you check rpm -qa | egrep ^cmake just to see what package(s) you have installed? As for getting a more recent version installed, if you enable the CentOS 8.5.2111 repositories, you should find cmake-3.20.2-4 in there. Just do an update from there using dnf. Edit: You should really get off CentOS Linux 8.5 as soon as possible. Migrate to AlmaLinux, CentOS Stream, or Rocky Linux. More on reddit.com
🌐 r/CentOS
6
3
March 18, 2022
🌐
Frontistr
manual.frontistr.com › en › install › install_07.html
Installation procedure to CentOS7.6(cmake) - FrontISTR ver. 5.6
We will explain how to install ... toolchains and libraries as follows. $ su # yum group mark install "Development Tools" # yum update # yum install openmpi-devel cmake # exit...
🌐
CentOS Repositories
centos.pkgs.org › 7 › okey-x86_64 › cmake3-3.12.1-2.el7.x86_64.rpm.html
cmake3-3.12.1-2.el7.x86_64.rpm CentOS 7 Download
CMake is quite sophisticated: it ... Warning! OKey is a third-party repository · Install OKey repository: # yum install http://repo.okay.com.mx/centos/7/x86_64/release/okay-release-1-1.noarch.rpm ·...
🌐
Bluhm-de
bluhm-de.com › home › linux › compile cmake on centos 7
Compile CMAKE on CentOS 7
So far, it has been tested with CMAKE 3.13.1 · CMAKE_VERSION=3.13.1 cd /tmp yum -y install gcc-c++ wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz tar xf cmake*.tar.gz cd cmake* ./bootstrap && make && make install
🌐
Blogger
jotmynotes.blogspot.com › 2016 › 10 › updating-cmake-from-2811-to-362-or.html
JotMyNotes: Updating CMake from 2.8.11 to 3.6.2 or Newer Version on CentOS Linux
October 4, 2016 - On CentOS 7, using yum install gives you cmake version 2.8.11 [root@thrift1 ~]# cat /etc/*release CentOS Linux release 7.2.1511 (Core) ...
🌐
CentOS Repositories
centos.pkgs.org › 7 › centos-x86_64 › cmake-2.8.12.2-2.el7.x86_64.rpm.html
cmake-2.8.12.2-2.el7.x86_64.rpm CentOS 7 Download
Install cmake rpm package: # yum install cmake · 2016-03-02 - Patsy Franklin <pfrankli@redhat.com> - 2.8.12.2-2 - Clean up patches and get rid of .orig files. 2016-02-26 - Patsy Franklin <pfrankli@redhat.com> - 2.8.12.2-1 - Rebase to 2.8.12.2 including some recent patches.
Find elsewhere
🌐
Steemit
steemit.com › undefined › @dothebest0927 › centos7-how-to-cmake-3-8-2-build-required-minimum-version-1
[CentOS7] How to cmake 3.8.2 build (Required minimum version) - 1 — Steemit
May 27, 2019 - How to larger space(https://sjnov11.github.io/blog/cent_os/2018/11/02/extend_disk_size_on_centos7.html) ** Virutal marchine : ** Guest OS : ** Host OS : Windows 10 ... *How To Install GCC on CentOS 7 : (https://linuxhostsupport.com/blog/how-to-install-gcc-on-centos-7/) $ yum -y install gcc //Gcc ...
🌐
GitHub
gist.github.com › zrsmithson › 8a1b7923a8f37dcb2e6b12b7e408fd50
Installing latest cmake and git versions on Rhel/Centos, and setting it as the default commands · GitHub
... For this, we will install the ... install curl-devel expat-devel gettext-devel openssl-devel zlib-devel sudo yum install gcc perl-ExtUtils-MakeMaker...
🌐
Cheaphosting
clientarea.cheaphosting.pk › knowledgebase › 103 › How-to-Install-Latest-CMake-on-CentOS.html
How to Install Latest CMake on CentOS? - Support Articles - CheapHosting.Pk
Enter the following commands on the terminal to upgrade PHP: 1 . To install the latest... g++: error: unrecognized command line option '-std=c++14' make: *** [src/core/ext/filters/census/grpc_context.lo] Error 1 ERROR: `make' failed · For CentOS run this. # yum install gcc-c++ Then Install cmake.
🌐
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 ...
🌐
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.
🌐
GitHub
gist.github.com › 1duo › 38af1abd68a2c7fe5087532ab968574e
Install CMake on CentOS 7. · GitHub
thanks for sharing @1duo. i did find two cmake paths and find CMAKE_BIN in R points to /usr/bin/cmake. but the include library shows /usr/local/bin. after changing the name in /usr/bin/cmake.
🌐
SourceExample
sourceexample.com › article › en › 68a27e3315ce3e52c7074e044b7969ff
Centos install the latest version of cmake
July 27, 2020 - wget -c https://github.com/Kitware/CMake/releases/download/v3.17.0-rc3/cmake-3.17.0-rc3.tar.gz tar zxvf cmake-3.17.0-rc3.tar.gz cd cmake-3.17.0-rc3./bootstrap gmake gmake install
Top answer
1 of 2
9

You don't say but what versions are you getting and what versions do you expect?

What repositories do I have?

You can find out what repositories your system is configured to query using this command:

$ yum repolist | expand
Loaded plugins: fastestmirror, priorities, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: centos.mirror.constant.com
 * epel: mirror.steadfast.net
 * extras: mirror.symnds.com
 * updates: bay.uchicago.edu
77 packages excluded due to repository priority protections
repo id         repo name                                               status
base            CentOS-6 - Base                                         6,297+70
epel            Extra Packages for Enterprise Linux 6 - x86_64            10,246
extras          CentOS-6 - Extras                                            7+7
updates         CentOS-6 - Updates                                           314
repolist: 16,864

Package info

You can query any package whether it's installed or not using yum info <pkg>.

$ yum info cmake
Loaded plugins: fastestmirror, priorities, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: centos.mirror.constant.com
 * epel: mirror.steadfast.net
 * extras: mirror.symnds.com
 * updates: bay.uchicago.edu
77 packages excluded due to repository priority protections
Installed Packages
Name        : cmake
Arch        : x86_64
Version     : 2.6.4
Release     : 5.el6
Size        : 18 M
Repo        : installed
From repo   : base
Summary     : Cross-platform make system
URL         : http://www.cmake.org
License     : BSD
Description : CMake is used to control the software compilation process using simple
            : platform and compiler independent configuration files. CMake generates
            : native makefiles and workspaces that can be used in the compiler
            : environment of your choice. CMake is quite sophisticated: it is possible
            : to support complex environments requiring system configuration, pre-processor
            : generation, code generation, and template instantiation.

Package's URL

You can find out where a RPM is being downloaded from using the repoquery command.

$ repoquery --location cmake
http://centos.mirrors.hoobly.com/6.5/os/x86_64/Packages/cmake-2.6.4-5.el6.x86_64.rpm

Which is part of this repository:

$ repoquery -i cmake | grep Repos
Repository  : base

So this is a base repository to the CentOS distro that's providing this package.

What other repositories have it?

You can query what repositories contain a specific package (at least most of the major repos) using pkgs.org.

  • http://pkgs.org/search/?query=cmake&type=smart

According to this list the EPEL repo has the latest version pre-built. The version of this package is as follows: cmake 28-2.8.11.2-1.

2 of 2
6

I needed cmake 2.8 on CentOS 6.5, but my attempts at using yum would also always keep cmake at 2.6 even though I tried adding repos that seemingly contained the correct version. It's kind of hacky, but I was able to get what I needed by executing the following commands as root:

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6.8.noarch.rpm
yum install cmake28
cd /usr/bin
mv cmake cmake26
mv ccmake ccmake26
mv cpack cpack26
mv ctest ctest26
ln -s cmake28 cmake
ln -s ccmake28 ccmake
ln -s cpack28 cpack
ln -s ctest28 ctest
🌐
Intel
intel.com › content › www › us › en › docs › programmable › 768970 › 2023-1 › centos-7-installation-notes.html
A.1. CentOS* 7 Installation Notes
April 5, 2023 - The Intel FPGA AI Suite does not ... SuiteI runtime to build properly. The commands to update cmake are as follows: sudo yum install -y cmake3 sudo yum remove cmake sudo ln -s /usr/bin/cmake3 /usr/bin/cmake cmake -–ve...