【问题标题】:How to install Postgresql in Vagrant box如何在 Vagrant 框中安装 Postgresql
【发布时间】:2012-04-27 05:02:24
【问题描述】:

我正在尝试将 postgresql 安装在一个 vagrant box 中,但没有运气。我尝试使用 Chef AND Puppet 进行配置,然后最后只是 ssh'd 进入盒子并尝试 apt-get install ... 结果是一样的。

通过厨师:

FATAL: Chef::Exceptions::Exec: package[postgresql-client] (postgresql::client line 37) had an error: apt-get -q -y install postgresql-client=8.4.8-0ubuntu0.10.04 returned 100, expected 0

通过 apt-get

apt-get install postgresql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libpq5 postgresql-8.4 postgresql-client-8.4 postgresql-client-common postgresql-common ssl-cert
Suggested packages:
  oidentd ident-server postgresql-doc-8.4
The following NEW packages will be installed:
  libpq5 postgresql postgresql-8.4 postgresql-client-8.4 postgresql-client-common postgresql-common
  ssl-cert
0 upgraded, 7 newly installed, 0 to remove and 5 not upgraded.
Need to get 4,899kB/4,952kB of archives.
After this operation, 20.6MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main libpq5 8.4.8-0ubuntu0.10.04
  404  Not Found [IP: 91.189.92.181 80]
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main postgresql-client-8.4 8.4.8-0ubuntu0.10.04
  404  Not Found [IP: 91.189.92.181 80]
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main ssl-cert 1.0.23ubuntu2 [10.9kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main postgresql-common 106ubuntu1 [88.2kB]
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main postgresql-8.4 8.4.8-0ubuntu0.10.04
  404  Not Found [IP: 91.189.92.181 80]
Err http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main postgresql 8.4.8-0ubuntu0.10.04
  404  Not Found [IP: 91.189.92.181 80]
Fetched 99.2kB in 1s (91.7kB/s)
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/postgresql-8.4/libpq5_8.4.8-0ubuntu0.10.04_i386.deb  404  Not Found [IP: 91.189.92.181 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/postgresql-8.4/postgresql-client-8.4_8.4.8-0ubuntu0.10.04_i386.deb  404  Not Found [IP: 91.189.92.181 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/postgresql-8.4/postgresql-8.4_8.4.8-0ubuntu0.10.04_i386.deb  404  Not Found [IP: 91.189.92.181 80]
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/postgresql-8.4/postgresql_8.4.8-0ubuntu0.10.04_all.deb  404  Not Found [IP: 91.189.92.181 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

有人遇到过这种情况还是我只是个假人? :)

【问题讨论】:

    标签: chef-infra vagrant


    【解决方案1】:

    猜测一下:您缓存的源索引已过期;运行

    apt-get clean; apt-get update
    

    然后再试一次。另一种可能性是中断请求的代理服务器(可能是透明的),甚至是坏镜像。如果您确认代理不是问题,请尝试在 /etc/apt/sources.list 中使用不同的镜像。

    这不是一个真正的 PostgreSQL 问题;建议取消标记。

    【讨论】:

    • 就是这样。 :) 未标记为 Postgresql
    • 我不同意这个答案——或者更确切地说,它是不完整的。在运行 postgres 配方之前,我们应该能够运行 apt-get update 作为 Chef 配置的一部分。
    猜你喜欢
    • 2015-04-29
    • 1970-01-01
    • 1970-01-01
    • 2016-03-20
    • 2015-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-08
    相关资源
    最近更新 更多