Centos – How to you install puppet on CentOS 7

centospuppet

CentOS 7 comes with ruby 2.0.0.353-20.el7. I'm trying to install puppet there, and running into errors. First I run:

rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-1.noarch.rpm

Those work fine. Then I run into problems with this:

[root@localhost /]# yum install puppet
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.beyondhosting.net
 * epel: mirrors.mit.edu
 * extras: mirror.tocici.com
 * updates: centos.chi.host-engine.com
Resolving Dependencies
--> Running transaction check
---> Package puppet.noarch 0:3.6.2-3.el7 will be installed
--> Processing Dependency: hiera >= 1.0.0 for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: facter >= 1.6.6 for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: rubygem(rgen) for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: ruby(shadow) for package: puppet-3.6.2-3.el7.noarch
--> Processing Dependency: ruby(augeas) for package: puppet-3.6.2-3.el7.noarch
--> Running transaction check
---> Package facter.x86_64 1:2.2.0-1.el6 will be installed
--> Processing Dependency: pciutils for package: 1:facter-2.2.0-1.el6.x86_64
---> Package hiera.noarch 0:1.3.4-1.el7 will be installed
---> Package ruby-augeas.x86_64 0:0.5.0-1.el7 will be installed
---> Package ruby-shadow.x86_64 1:2.2.0-2.el6 will be installed
--> Processing Dependency: libruby.so.1.8()(64bit) for package: 1:ruby-shadow-2.2.0-2.el6.x86_64
---> Package rubygem-rgen.noarch 0:0.6.6-2.el7 will be installed
--> Running transaction check
---> Package pciutils.x86_64 0:3.2.1-4.el7 will be installed
---> Package ruby-shadow.x86_64 1:2.2.0-2.el6 will be installed
--> Processing Dependency: libruby.so.1.8()(64bit) for package: 1:ruby-shadow-2.2.0-2.el6.x86_64
--> Finished Dependency Resolution
Error: Package: 1:ruby-shadow-2.2.0-2.el6.x86_64 (puppetlabs-deps)
           Requires: libruby.so.1.8()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@localhost /]#

It looks like it requires ruby 1.8. Ruby 2.0 is installed by default, and looks to be the earliest available. What am I missing?

Best Answer

It appears that you had the puppetlabs repo for EL6 installed, then removed and replaced it with the repo for EL7. But yum still has cached data for the EL6 repo. Just clean it out and try again.

yum clean all