【问题标题】:Unable to install using chef-apply无法使用 chef-apply 安装
【发布时间】:2015-10-28 04:26:24
【问题描述】:

系统 - 信息

Linux chef-VirtualBox 3.13.0-32-generic #57~precise1-Ubuntu SMP Tue Jul 15 03:50:54 UTC 2014 i686 i686 i386 GNU/Linux

厨师版

Chef: 12.4.1

vi webserver.rb

package 'apache2'

语言环境

LANG=en_IN
LANGUAGE=en_IN:en
LC_CTYPE="en_IN"
LC_NUMERIC="en_IN"
LC_TIME="en_IN"
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=

注意:

LC_ALL= is BLANK

sudo chef-apply webserver.rb

Recipe: (chef-apply cookbook)::(chef-apply recipe)
* apt_package[apache2] action install

================================================================================
Error executing action `install` on resource 'apt_package[apache2]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y install apache2=2.2.22-1ubuntu1.10 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  x11-apps libxrandr-ltst2 x11-xfs-utils libtxc-dxtn-s2tc0
  libwayland-ltst-server0 libxcb-xfixes0 libdrm-nouveau2 xinit
  x11-session-utils libfs6 libxvmc1 libxcb-dri2-0 libwayland-ltst-client0
  libllvm3.4
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1
  libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
  libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
0 upgraded, 9 newly installed, 0 to remove and 236 not upgraded.
Need to get 1836 kB of archives.
After this operation, 5230 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
STDERR: E: There are problems and -y was used without --force-yes
---- End output of apt-get -q -y install apache2=2.2.22-1ubuntu1.10 ----
Ran apt-get -q -y install apache2=2.2.22-1ubuntu1.10 returned 100

Resource Declaration:
---------------------
# In webserver.rb

  1: package 'apache2' 

Compiled Resource:
------------------
# Declared in webserver.rb:1:in `run_chef_recipe'

apt_package("apache2") do
  action [:install]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  package_name "apache2"
  version "2.2.22-1ubuntu1.10"
  declared_type :package
  cookbook_name "(chef-apply cookbook)"
  recipe_name "(chef-apply recipe)"
end

[2015-08-05T17:18:54+05:30] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-08-05T17:18:54+05:30] FATAL: Mixlib::ShellOut::ShellCommandFailed: apt_package[apache2] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y install apache2=2.2.22-1ubuntu1.10 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  x11-apps libxrandr-ltst2 x11-xfs-utils libtxc-dxtn-s2tc0
  libwayland-ltst-server0 libxcb-xfixes0 libdrm-nouveau2 xinit
  x11-session-utils libfs6 libxvmc1 libxcb-dri2-0 libwayland-ltst-client0
  libllvm3.4
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1
  libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom
 The following NEW packages will be installed:

apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap 0 升级,9 新安装,0 删除,236 未升级。 需要获得 1836 kB 的档案。 此操作后,将使用 5230 kB 的额外磁盘空间。 警告:以下软件包无法通过身份验证! libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap STDERR: E: 有问题并且 -y 在没有 --force-yes 的情况下使用 ---- apt-get -q -y install apache2=2.2.22-1ubuntu1.10 的结束输出---- 跑 apt-get -q -y install apache2=2.2.22-1ubuntu1.10 返回 100 chef@chef-VirtualBox:~/chef-repo$

【问题讨论】:

  • 请考虑格式化您的问题
  • 完成了,希望现在更好

标签: apache2 chef-infra locale


【解决方案1】:

更新 webserver.rb 如下

package 'apache2' do
    options '--force-yes'
end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多