【问题标题】:Chef install of readline package fails on Ubuntu 14.04在 Ubuntu 14.04 上安装 readline 包的 Chef 失败
【发布时间】:2014-10-18 21:22:10
【问题描述】:

我正在尝试使用 Chef 在 Ubuntu 节点上安装 PostgreSQL(服务器):

角色定义(roles/base_server.rb):

run_list(
  "recipe[apt]",
  "recipe[postgres::server]"
)

default_attributes(
  postgresql: {
    version:  "9.3.4",
     config: {
      shared_buffers_mb: "12000"
  }
}

设置

系统:Ubuntu 14.04 LTS(GNU/Linux 3.13.0-24-generic x86_64)

厨师版:11.14.6

Postgres 食谱:[3.4.1] (https://github.com/hw-cookbooks/postgresql)

运行引导命令

刀引导IPADDRESS -x USER -r 'role[base_server]' --sudo

导致以下错误:

* package[readline] action install
  * No version specified, and no candidate version available for readline
  ================================================================================
  Error executing action `install` on resource 'package[readline]'
  ================================================================================

  Chef::Exceptions::Package
  -------------------------
  No version specified, and no candidate version available for readline

  Resource Declaration:
  ---------------------
  # In /var/chef/cache/cookbooks/postgres/recipes/build.rb

   29:   package package_name do
   30:     action :install
   31:   end
   32: end

  Compiled Resource:
  ------------------
  # Declared in /var/chef/cache/cookbooks/postgres/recipes/build.rb:29:in `block in from_file'

  package("readline") do
    action [:install]
    retries 0
    retry_delay 2
    guard_interpreter :default
    package_name "readline"
    timeout 900
    cookbook_name "postgres"
    recipe_name "build"
  end

我已经尝试通过手动安装 readline 库来解决这个问题,但没有成功。有谁知道如何解决这个问题?

【问题讨论】:

  • 您需要首先在您的run_list 中包含apt cookbook 以更新apt 缓存。
  • 上面的运行列表中的“recipe[apt]”不是已经这样做了吗?
  • 我同意。您是否尝试过手动运行apt-get update && apt-get install readline
  • apt-get install readline 给了我一个E: Unable to locate package readline。另一方面,apt-get install libreadline6 libreadline6-dev 告诉我一切都是最新的。
  • 所以这不是厨师问题,而更多是由您的 Ubuntu 安装引起的。根据packages.ubuntu.com 没有readline 包,只有readline-common。所以这是食谱中的一个问题。但我想知道你用的是什么食谱。没有build 配方here

标签: postgresql chef-infra recipe


【解决方案1】:

正如 StephenKing 所提到的,问题不在于 Chef,而在于该包确实不存在。您需要修复您的配方代码以使用正确的包名称。

【讨论】:

    猜你喜欢
    • 2016-02-29
    • 1970-01-01
    • 2023-03-31
    • 2015-06-08
    • 1970-01-01
    • 2015-09-25
    • 2019-03-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多