已解决 - 无法在 CentOS 6.9 上安装 foreman-proxy

已解决 - 无法在 CentOS 6.9 上安装 foreman-proxy

木偶

[root@ns1 ~]# puppet --version
4.10.1

存储库(使用 Foreman 1.12,因为 Centos 6 不支持下一个版本)

[root@ns1 ~]# yum repolist enabled
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.coreix.net
 * epel: mirror.nl.leaseweb.net
 * extras: repo.uk.bigstepcloud.com
 * remi: remi.mirror.wearetriple.com
 * remi-safe: remi.mirror.wearetriple.com
 * updates: repo.uk.bigstepcloud.com
repo id                                                                                          repo name                                                                                                                             status
base                                                                                             CentOS-6 - Base                                                                                                                        6,706
centos-sclo-rh                                                                                   CentOS-6 - SCLo rh                                                                                                                     5,553
centos-sclo-sclo                                                                                 CentOS-6 - SCLo sclo                                                                                                                     300
epel                                                                                             Extra Packages for Enterprise Linux 6 - x86_64                                                                                        12,309
extras                                                                                           CentOS-6 - Extras                                                                                                                         45
foreman                                                                                          Foreman 1.12                                                                                                                             460
foreman-plugins                                                                                  Foreman plugins 1.12                                                                                                                     240
percona-release-noarch                                                                           Percona-Release YUM repository - noarch                                                                                                   43
percona-release-x86_64                                                                           Percona-Release YUM repository - x86_64                                                                                                1,328
puppetlabs-deps                                                                                  Puppet Labs Dependencies El 6 - x86_64                                                                                                    77
puppetlabs-products                                                                              Puppet Labs Products El 6 - x86_64                                                                                                       565
remi                                                                                             Remi's RPM repository for Enterprise Linux 6 - x86_64                                                                                  4,190
remi-safe                                                                                        Safe Remi's RPM repository for Enterprise Linux 6 - x86_64                                                                             1,782
updates                                                                                          CentOS-6 - Updates                                                                                                                       354
repolist: 33,952

领班

[root@ns1 ~]# yum -y install foreman-installer

[root@ns1 ~]# foreman-installer
...
 Execution of '/usr/bin/yum -d 0 -e 0 -y install foreman-proxy' returned 1: Error: Package: foreman-proxy-1.12.4-1.el6.noarch (foreman)
 /Stage[main]/Foreman_proxy::Install/Package[foreman-proxy]/ensure: change from purged to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install foreman-proxy' returned 1: Error: Package: foreman-proxy-1.12.4-1.el6.noarch (foreman)                                                                                                                                                                                                                                          
[FAILED]main]/Puppet::Server::Service/Service[puppetserver]: Failed to call refresh: Could not start Service[puppetserver]: Execution of '/sbin/service puppetserver start' returned 1: Starting puppetserver: [FAILED]
[FAILED]main]/Puppet::Server::Service/Service[puppetserver]: Could not start Service[puppetserver]: Execution of '/sbin/service puppetserver start' returned 1: Starting puppetserver: [FAILED]
...

工头代理

[root@ns1 ~]# yum install foreman-proxy
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.coreix.net
 * epel: mirror.nl.leaseweb.net
 * extras: repo.uk.bigstepcloud.com
 * remi: remi.mirror.wearetriple.com
 * remi-safe: remi.mirror.wearetriple.com
 * updates: repo.uk.bigstepcloud.com
Resolving Dependencies
--> Running transaction check
---> Package foreman-proxy.noarch 0:1.12.4-1.el6 will be installed
--> Processing Dependency: rubygem(sinatra) for package: foreman-proxy-1.12.4-1.el6.noarch
--> Finished Dependency Resolution
Error: Package: foreman-proxy-1.12.4-1.el6.noarch (foreman)
           Requires: rubygem(sinatra)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

--skip-broken key does not help in this case

rubygem-sinatra

[root@ns1 ~]# yum install rubygem-sinatra
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.coreix.net
 * epel: mirror.nl.leaseweb.net
 * extras: repo.uk.bigstepcloud.com
 * remi: remi.mirror.wearetriple.com
 * remi-safe: remi.mirror.wearetriple.com
 * updates: repo.uk.bigstepcloud.com
No package rubygem-sinatra available.
Error: Nothing to do

[root@ns1 ~]# gem install sinatra
ERROR:  Error installing sinatra:
        rack requires Ruby version >= 2.2.2.

Tried previous version:

[root@ns1 ~]# gem install sinatra -v 1.4.8
Successfully installed rack-1.6.8
Successfully installed rack-protection-1.5.3
Successfully installed sinatra-1.4.8
3 gems installed
Installing ri documentation for rack-1.6.8...
Installing ri documentation for rack-protection-1.5.3...
Installing ri documentation for sinatra-1.4.8...
Installing RDoc documentation for rack-1.6.8...
Installing RDoc documentation for rack-protection-1.5.3...
Installing RDoc documentation for sinatra-1.4.8...

然而,由于同样的错误,foreman-proxy 仍然无法安装:

Error: Package: foreman-proxy-1.12.4-1.el6.noarch (foreman)
           Requires: rubygem(sinatra)

答案1

您可以从以下位置下载 Sinatra rpmhttp://www.rpmseek.com/rpm-pl/rubygem-sinatra.html?hl=com&cs=rubygems:RE:0:0:0:0:800并安装它。

答案2

当你尝试使用它安装时,foreman-proxyyum不知道你的gem软件包。它只使用rpm数据库。所以你应该rubygem-sinatra通过 yum 安装,rubygem-sinatra可以位于epelrepo 中。你可以用命令安装它yum install epel-release。运行后yum install rubygem-sinatra

我通过命令找到了它:

[root@~ ]# yum provides rubygem-sinatra
1:rubygem-sinatra-1.4.8-2.el7.noarch : Ruby-based web application framework 
Repo        : epel

我的答案在 CentOS 7 中进行了测试。

更新

对于 CentOS 6,你可以尝试从本网站 sudo rpm -i https://driesrpms.eu/redhat/el6/en/x86_64/dries.all/RPMS/rubygem-sinatra-1.1.3-1.el6.rf.noarch.rpm --nodeps

相关内容