2013-04-04 70 views
0

我使用vagrant來創建在Ubuntu 10.04上運行的postgresql實例,使用opscode食譜,但由於某些原因,apt-get update在postgresql運行之前未被調用,所以apt-get install postgresql命令失敗並出現404錯誤。任何人都可以幫助廚師新手出去嗎?我查看了其餘的答案,但似乎沒有任何工作。apt-get update在postgresql安裝前未運行

STDOUT: Reading package lists... 
Building dependency tree... 
Reading state information... 
The following extra packages will be installed: 
    libpq5 postgresql-client postgresql-client-8.4 postgresql-client-common 
Suggested packages: 
    postgresql-8.4 postgresql-doc-8.4 
The following NEW packages will be installed: 
    libpq5 postgresql-client postgresql-client-8.4 postgresql-client-common 
0 upgraded, 4 newly installed, 0 to remove and 52 not upgraded. 
Need to get 941kB of archives. 
After this operation, 5,300kB of additional disk space will be used. 
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libpq5 8.4.6-0ubuntu10.04 
    404 Not Found [IP: 91.189.91.13 80] 
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main postgresql-client-common 106ubuntu1 
    404 Not Found [IP: 91.189.91.13 80] 
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main postgresql-client-8.4 8.4.6-0ubuntu10.04 
    404 Not Found [IP: 91.189.91.13 80] 
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main postgresql-client 8.4.6-0ubuntu10.04 
    404 Not Found [IP: 91.189.91.13 80]STDERR: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/postgresql-8.4/libpq5_8.4.6-0ubuntu10.04_i386.deb 404 Not Found [IP: 91.189.91.13 80] 

回答

2

默認情況下,廚師不運行apt-get update。你必須明確地告訴它這樣做。

我建議您:

  • 槓桿Opscode公司的apt食譜和安裝postgresql之前調用include_recipe "apt::default";或

  • 添加廚師前殼供應方在Vagrantfile

    config.vm.provision :shell, :inline => 'apt-get update'

首先就可以在所有應用的食譜,第二個會運行更新,每次的流浪VM被提供,但如果您在別處使用食譜,則不會強制更新。