2

有人知道如何解决 php 扩展的依赖问题吗?

默认.pp

class { 'php':
  package => 'php5',
  service => 'apache',
  version => '5.2.10.dfsg.1-2ubuntu6.5',
  require => Package['apache'],
}

package { "PhpModule_mhash":
  ensure   => '5.2.10.dfsg.1-2ubuntu6.5',
  name     => 'php5-mhash',
  require  => [Package['php'], Package['PhpModule_common'], ],
}

vagrant up我收到err

err: /Stage[main]//Package[PhpModule_mhash]/ensure: change from purged to 5.2.10.dfsg.1-2ubuntu6.5 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install php5-mhash=5.2.10.dfsg.1-2ubuntu6.5' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
php5-mhash : Depends: php5 but it is not going to be installed or
                   phpapi-20060613+lfs
E: Unable to correct problems, you have held broken packages.
at /tmp/vagrant-puppet/manifests/default.pp:79

我的虚拟盒存储库是最新的,并且所有必需的软件包都可用。PHP也安装没有问题。

非常有趣的是,当我vagrant ssh执行以下命令时:

/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install php5-mhash=5.2.10.dfsg.1-2ubuntu6.5

它在没有任何通知的情况下安装...

  1. 有没有办法告诉Packagephp5 已经安装?
  2. 如果我已经需要包,有没有办法省略依赖项?
  3. 在 Puppet 或 Debian 方面我有哪些选择?

提前致谢

4

1 回答 1

0

木偶就是答案!

尽管我已经指定 *PhpModule_mhash* 包需要php类,但我必须在我的清单中插入链接。

Class['php'] -> Package['PhpModule_common'] -> Package['PhpModule_cli'] -> Package['PhpModule_mhash']
于 2013-05-27T16:02:03.857 回答