Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

httpd is a virtual package provided by multiple packages, you must explicitly select one

I was following the chef tutorial. My workstation is Ubuntu. At the step 'Install the Apache package'.

I wrote a recipe which contains only "package 'httpd'". I was supposed to install Apache after that. However, I got an error:

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

Chef::Exceptions::Package
-------------------------
httpd is a virtual package provided by multiple packages, you must explicitly select one

Resource Declaration:
---------------------
# In /home/local/ANT/yuqiw/chef-repo/webserver.rb

  2: apt_package("httpd")

Compiled Resource:
------------------
# Declared in /home/local/ANT/yuqiw/chef-repo/webserver.rb:2:in `from_file'

apt_package("httpd") do
  package_name "httpd"
  action [:install]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  declared_type :apt_package
  cookbook_name "@recipe_files"
  recipe_name "/home/local/ANT/yuqiw/chef-repo/webserver.rb"
end

Platform:
---------
x86_64-linux

Can anyone help me out?

like image 567
Henry Avatar asked Mar 24 '17 00:03

Henry


2 Answers

The package called httpd on RHEL/CentOS/Fedora is called apache2 in Debian/Ubuntu. At the start of the tutorial you had to pick if you were using Ubuntu or CentOS, you probably picked the incorrect one. Just go back to that screen and click the other link.

like image 174
coderanger Avatar answered Nov 03 '22 15:11

coderanger


service 'apache2' do
    action :install
end

Try to use it further in the tutorial.

like image 1
Adam Godefroy Avatar answered Nov 03 '22 15:11

Adam Godefroy