4

I'm trying to do this in chef:

package("libreadline5-dev") do
  package_name "libreadline5-dev"
  retry_delay 2
  retries 0
  recipe_name "default"
  cookbook_name :"nginx-passenger"
  action :install
end

It gives following error:

================================================================================
Error executing action `install` on resource 'package[libreadline5-dev]'
================================================================================

Chef::Exceptions::Package
-------------------------
libreadline5-dev has no candidate in the apt-cache

Resource Declaration:
---------------------
# In /var/chef/cookbooks/nginx-passenger/recipes/default.rb

 15: package "libreadline5-dev"
 16: package "build-essential"

Compiled Resource:
------------------
# Declared in /var/chef/cookbooks/nginx-passenger/recipes/default.rb:15:in `from_file'

Versions:

ruby 1.8.7

Chef: 10.16.2

ubuntu: 12.04 (EC2 instance)

Can someone help me fix this? I tried this but it didn't fix the issue.

Community
  • 1
  • 1
Srinivas
  • 432
  • 5
  • 22

3 Answers3

5

AFAIK, libreadline5-dev is no longer included in Ubuntu 12.04.

You may wish to try with libreadline-dev instead.

Mike Fiedler
  • 691
  • 1
  • 11
  • 26
  • thank you for the reply. I could not fix this. have given up for now. Will get back on this post when i get behind this again :) – Srinivas Feb 20 '13 at 09:29
0

I had the same problem with the ntp package installed by the ntp cookbook.

After executing

apt-get check
apt-get update
chef-client

in the shell on a debian machine by hand it worked for me but I couldn't find out what caused the trouble. Maybe someone has an idea?

Hope that helps.

kr1sp1n
  • 76
  • 1
  • 4
  • I think this is a different problem - sometimes providing the log output of what helped is essential to debugging this kind of problem. – Mike Fiedler Jan 19 '13 at 01:56
  • thank you for the reply. I could not get to fix this. have given up for now. Will get back on this post when i get behind this again :) – Srinivas Feb 20 '13 at 09:30
0

I'm really late to the party, but I didn't really find any results when searching for this error, except for this question. I ran into the same problem, and it was caused by an old stale apt-get process that was keeping apt-purge from getting a lock. You can confirm that by trying apt-get update:

$ sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the list directory

$ ps auxww | grep apt
root     23488  0.0  0.0  19408  2336 ?        S    Jun03  28:42 /usr/bin/apt-get -q -y --force-yes -o Dpkg::Options::=--force-confold update

after manually killing that apt-get process, and running apt-get update, chef ran successfully.

garrettux
  • 169
  • 4