2013-05-26 48 views
2

有誰知道如何解決php擴展的依賴問題?從傀儡安裝時PHP擴展依賴問題

default.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. 有沒有辦法告訴Package是PHP5已經安裝?
  2. 有沒有辦法省略依賴關係,如果我已經要求包?
  3. 我對Puppet或Debian方有什麼選擇?

在此先感謝

回答

0

木偶Chaining就是答案!

儘管我已經指定了* PhpModule_mhash * package`requires php class我不得不在我的清單中插入鏈接。

Class['php'] -> Package['PhpModule_common'] -> Package['PhpModule_cli'] -> Package['PhpModule_mhash']