0

opscodeクックブックを使用して、vagrantを使用してUbuntu 10.04で実行されるpostgresqlのインスタンスを作成していますが、何らかの理由apt-get updateでpostgresqlが実行される前に呼び出されないため、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]
4

1 に答える 1

2

apt-get updateChef はデフォルトでは実行されません。そうするように明示的に伝える必要があります。

次のいずれかをお勧めします。

  • インストールする前に、 Opscode のaptクックブックと呼び出しを活用します。またinclude_recipe "apt::default"postgresql

  • で Chef の前にシェル プロビジョナーを追加しますVagrantfile

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

1 つ目はクックブックを適用するすべての場所で機能し、2 つ目は Vagrant VM がプロビジョニングされるたびに更新を実行しますが、他の場所でクックブックを使用する場合は更新を強制しません。

于 2013-04-05T00:11:25.740 に答える