无法使用chef-apply安装

时间:2015-08-05 11:52:51

标签: apache2 chef locale

系统 - 信息

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 ---- Ran apt-get -q -y install apache2 = 2.2.22-1ubuntu1.10返回100 chef @ chef-VirtualBox:〜/ chef-repo $

1 个答案:

答案 0 :(得分:0)

更新了webserver.rb,如下所示

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