如何在 CentOS 7 上安装 Puppet

如何在 CentOS 7 上安装 Puppet

CentOS 7 附带 ruby​​ 2.0.0.353-20.el7。我尝试在那里安装 puppet,但遇到了错误。首先我运行:

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

这些工作正常。然后我遇到了这个问题:

[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 /]#

看起来它需要 ruby​​ 1.8。默认情况下会安装 Ruby 2.0,并且看起来是最早可用的版本。我遗​​漏了什么?

答案1

看来您安装了 EL6 的 puppetlabs 存储库,然后将其删除并替换为 EL7 的存储库。但 yum 仍缓存有 EL6 存储库的数据。只需将其清除并重试。

yum clean all

相关内容