我正在使用vagrant来创建在Ubuntu 10.04上运行的postgresql实例,使用opscode cookbooks,但由于某种原因{post>运行postgresql之前没有调用apt-get update
,所以apt-get install postgresql
命令因404错误而失败。任何人都可以帮助厨师新手出去吗?我已经查看了其余的答案,但似乎没有任何效果。
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]
答案 0 :(得分:2)
默认情况下,Chef永远不会运行apt-get update
。你必须明确告诉它这样做。
我建议你:
在安装apt
之前,利用Opscode的include_recipe "apt::default"
食谱并致电postgresql
;或
在Vagrantfile
:
config.vm.provision :shell, :inline => 'apt-get update'
第一个适用于您应用菜谱的任何地方,第二个将在每次配置Vagrant VM时运行更新,但如果您在其他地方使用该菜谱,则不会强制更新。