9

For some reason when I run yum to get cmake it will install an older version. Could it be because my repo list is not complete? I'm on CentOS 6 using a minimal desktop install from the non-net install CD. Could anyone give me a repo link or something?

Same thing happens on Scientific Linux.

I would take compiling it myself as a last resort because I'm trying to make yum install cmake work in a bash script.

  • Look at your yum configuration in /etc/yum.repos.d/*; is there anything in there that is locking the installed version down. – DopeGhoti Jan 8 '14 at 7:02
  • I dont think so, everything looks normal and is default, this is a clean install. – Dominique Jan 8 '14 at 7:12
  • Are the repositories where the package resides actually set to enabled=1? – DopeGhoti Jan 8 '14 at 7:17
  • 1
    How are you deciding that the package is out of date? Isn't it possible that your distro simply has an older version in its repositories? – strugee Jan 8 '14 at 7:52
  • I recently had to make some OpenCV builds in an updated Debian GNU/Linux based operating system. The precompiled available CMake was too old to build OpenCV ok, but downloading and building CMake solved the problem very well. – john Jan 8 '14 at 11:13
7

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.

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.

  • I found that ATrpms Testing repository has the version I need. I installed it and used that repo to get the latest version, thanks. – Dominique Jan 8 '14 at 18:07
  • @Dominique - great, glad you resolved your issue! – slm Jan 8 '14 at 18:09
  • Thank you for this resolution! And thank you [again] for the extra information given about the yum/repo mgmt commands. – jredd Mar 29 '14 at 1:19
  • @jRadd - you're quite welcome! – slm Mar 29 '14 at 1:22
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.